Killing threads

imageguy imageguy1206 at
Mon Apr 6 02:27:15 CEST 2009

> For more info, see the slides from my thread tutorial:
> --
> Aahz (a... at           <*>
Aahz, thanks for this reference and link to your presentation.  At the
risk of highjacking the OP's question, I am bit confused as to how
using an Event would cause a deadlock.  You presentation outlines
Events, but doesn't elaborate on the specifics or usage.

In threading.Event python 2.5 docs say;
"This is one of the simplest mechanisms for communication between
threads: one thread signals an event and other threads wait for it. "

Again, I have limited experience, however, in my reading of the
threading manual and review examples, Events were specifically design
to be a thread safe way to communicate a 'state' to running threads ?
In the OP's example 'do stuff' was open to wide interpretation,
however, if within the thread's main 'while' loop the tread checks to
see if the 'keepgoing' Event.isSet(), in what scenario would this
create deadlock ?

Thanks for your patience.  I thought I had grasped the basics of using
threads/threading, so hope I can learn more.


More information about the Python-list mailing list