Message139852
> 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. |
|
Date |
User |
Action |
Args |
2011-07-05 11:29:35 | pitrou | set | recipients:
+ pitrou, gregory.p.smith, vstinner, nirai, bobbyi, neologix, Giovanni.Bajo, sdaoden, avian |
2011-07-05 11:29:34 | pitrou | link | issue6721 messages |
2011-07-05 11:29:34 | pitrou | create | |
|