This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Giovanni.Bajo, avian, bobbyi, gregory.p.smith, neologix, nirai, pitrou, sdaoden, vstinner
Date 2011-07-05.11:29:34
SpamBayes Score 7.550704e-10
Marked as misclassified No
Message-id <1309865326.3683.3.camel@localhost.localdomain>
In-reply-to <1309864842.21.0.629203178239.issue6721@psf.upfronthosting.co.za>
Content
> Except for multiprocessing, does anyone know of any other module in
> the standard library that uses fork() and threads at the same time?
> After some grepping through the source I couldn't find any other
> cases.

It's quite common to launch a subprocess from a thread, so as to
communicate with the subprocess without blocking the main thread. I'm
not sure the stdlib itself does it, but the test suite does (when run in
parallel mode).

> I'm prepared to work on a patch that would remove the need for helper
> threads in the multiprocessing module.

Your contribution is welcome.

> Just to clarify: it's not that POSIX atfork() handlers run from signal
> handlers. It's that after a fork in a multithreaded process POSIX only
> guarantees calls to "safe" functions, which is the same set of
> functions as those that are safe to call from signal handlers.

For the record, I would consider POSIX totally broken from this point of
view. It seems most modern systems allow much more than that,
fortunately.
History
Date User Action Args
2011-07-05 11:29:35pitrousetrecipients: + pitrou, gregory.p.smith, vstinner, nirai, bobbyi, neologix, Giovanni.Bajo, sdaoden, avian
2011-07-05 11:29:34pitroulinkissue6721 messages
2011-07-05 11:29:34pitroucreate