Antoine Pitrou <pit...@free.fr> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6721>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to