Eryk Sun added the comment:

> all atexit handlers, for example, would be called multiple times.

Davin is (I think) proposing a multiprocessing atexit facility, which can be 
used to ensure threading._shutdown is called. But could Python's regular atexit 
handling be reset in the child, allowing Py_Finalize to be called? In other 
words, can atexit can be integrated into the PyOS_AfterFork 
(Modules/signalmodule.c) sequence? multiprocessing could set a sys flag that 
forces atexit to clear its registered handlers, and for Py_AtExit, reset the 
static nexitfuncs variable in Python/pylifecycle.c. Or is that just opening a 
can of worms that will cause Py_Finalize to crash in various scenarios?

> There's also the problem that fork() isn't MT-safe

This issue is about joining Python threads created in the child, which has a 
clean slate via PyOS_AfterFork, PyEval_ReInitThreads (Python/ceval.c), and 
threading._after_fork.

----------

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

Reply via email to