Atomic Event.{wait,clear}

David Given dg at pearl.tao.co.uk
Tue Mar 13 06:59:08 EST 2001


I'm using the threading module, with the Event class to handle
synchronisation. It's all working nicely and is very easy to use.

However, I can't seem to find a way of atomically waiting for an Event,
and then clearing the flag, which is very strange. Currently I do
Event.wait() and then Event.clear(). If another thread does a Event.set()
in between the two, the event will be lost. For my current application,
this isn't a problem, but what shold I do in the future?

-- 
+- David Given ---------------McQ-+ 
|  Work: dg at tao-group.com         | Uglúk u bagronk sha pushdug Internet-glob
|  Play: dgiven at iname.com         | búbhosh skai.                              
+- http://wired.st-and.ac.uk/~dg -+ 



More information about the Python-list mailing list