Killing threads

imageguy imageguy1206 at gmail.com
Sun Apr 5 20:27:15 EDT 2009


> For more info, see the slides from my thread tutorial:http://pythoncraft.com/OSCON2001/
> --
> Aahz (a... at pythoncraft.com)           <*>        http://www.pythoncraft.com/
>
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.

g.





More information about the Python-list mailing list