[Python-Dev] PEP 3148 ready for pronouncement

Reid Kleckner rnk at mit.edu
Fri May 28 03:57:48 CEST 2010


On Thu, May 27, 2010 at 4:13 AM, Brian Quinlan <brian at sweetapp.com> wrote:
> Keep in mind that this library magic is consistent with the library magic
> that the threading module does - unless the user sets Thread.daemon to True,
> the interpreter does *not* exit until the thread does.

Is there a compelling to make the threads daemon threads?  If not,
perhaps they can just be normal threads, and you can rely on the
threading module to wait for them to finish.

Unrelatedly, I feel like this behavior of waiting for the thread to
terminate usually manifests as deadlocks when the main thread throws
an uncaught exception.  The application then no longer responds
properly to interrupts, since it's stuck waiting on a semaphore.  I
guess it's better than the alternative of random crashes when daemon
threads wake up during interpreter shutdown, though.

Reid


More information about the Python-Dev mailing list