[Python-ideas] An error in multiprocessing on MacOSX?
Sturla Molden
sturla at molden.no
Mon Nov 26 22:23:33 CET 2012
Den 21. nov. 2012 kl. 23:18 skrev Richard Oudkerk <shibturn at gmail.com>:
>
> An implementation is available at
>
> http://hg.python.org/sandbox/sbt#spawn
>
> You just need to stick
>
> multiprocessing.set_start_method('spawn')
>
> at the beginning of the program to use fork+exec instead of fork. The test suite passes. (I would not say that making this work was that straightforward though.)
>
> That branch also supports the starting of processes via a server process. That gives an alternative solution to the problem of mixing fork() with threads, but has the advantage of being as fast as the default fork start method. However, it does not work on systems where fd passing is unsupported like OpenSolaris.
>
That is very nice, thank you :-)
BTW, fd passing is possible on Windows too, using DuplicateHandle. One can "inject" an open file handle into a different process, but some means of ipc (e.g. a pipe) must be used to communicate it's value.
Sturla
More information about the Python-ideas
mailing list