[issue9863] threading, signals, atexit: different execution with different versions

Corey Bertram report at bugs.python.org
Thu Sep 16 01:06:54 CEST 2010


Corey Bertram <corey at qr7.com> added the comment:

let me preface this: I'm no expert on how this should be done ect...

The goal here was to specifically not set daemon on the test_loop thread. In an actual app test_loop would perhaps need to shutdown cleanly (save state or what have you). That said, your previous suggestion of moving the setting of terminate to the close handler (or maybe just call shutdown) works, but defeats the whole purpose of using atexit at all.

My understanding is that the main thread has ended execution due to the signal. If the signal handler called shutdown, when the test_loop thread exits, all of the atexit registered functions would execute (in this example it would mean calling the shutdown function twice). It just seems ugly now no matter what.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9863>
_______________________________________


More information about the Python-bugs-list mailing list