Richard Oudkerk added the comment:
http://hg.python.org/sandbox/sbt#spawn now contains support for starting
processes via a separate server process. This depends on fd passing support.
This also solves the problem of mixing threads and processes, but is much
faster than using fork+exec. It seems to be just as fast as using plain fork.
I have tested it successfully on Linux and a MacOSX buildbot. (OpenSolaris
does not seem to support fd passing.)
At the begining of your program you write
to use the fork server.
Alternatively you can use
to use _posixsubprocess.fork_exec() with closefds=True on Unix or
to use the standard fork method.
This branch also stops child processes on Windows from automatically inheriting
The test suite can be run with the different start methods by doing
python -m test.test_multiprocessing_fork
python -m test.test_multiprocessing_spawn
python -m test.test_multiprocessing_forkserver
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list