[issue1856] shutdown (exit) can hang or segfault with daemon threads running

Gregory P. Smith report at bugs.python.org
Thu Jan 17 22:32:19 CET 2008


Gregory P. Smith added the comment:

agreed, during shutdown the other threads should be stopped.  anything
to do this complicates acquiring and releasing the GIL by adding another
check to see if we're shutting down.

brainstorm: I haven't looked at the existing BEGIN_ALLOW_THREADS and
END_ALLOW_THREADS implementations but would it be possible to modify
them on the fly from the thread doing the shutdown (main or not) while
it holds the GIL such that all future calls to BEGIN_ALLOW_THREADS do
not actually release the GIL and END_ALLOW_THREADS always blocks.  That
should bring other threads to a halt pretty quickly and prevent
destructors from releasing the GIL (file.close, etc).

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1856>
__________________________________


More information about the Python-bugs-list mailing list