On this page
posix.fork
Prev: posix.fchown | Up: posix | Next: posix.forkpty
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.fork
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import fork
Signature & Overview
posix.fork()
Fork a child process.
Usage
import os
# Low-level Unix process fork; unsafe in multi-threaded processes
assert hasattr(os, 'fork') or True
Gotchas
- Prefer
subprocessormultiprocessing(spawn) in multi-threaded apps.
REPL Inspect
from posix import fork
help(fork)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/fchown Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/forkpty Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chown shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chroot shared tags: #posix, #stdlib