On May 28, 2010, at 11:57 AM, Reid Kleckner wrote:

On Thu, May 27, 2010 at 4:13 AM, Brian Quinlan <br...@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.

Did you read my explanation of the reasoning behind my approach?

Cheers,
Brian

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

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to