python threading

Aahz aahz at pythoncraft.com
Tue Apr 16 16:48:18 EDT 2002


In article <mailman.1018978678.13870.python-list at python.org>,
Justin Sheehy  <justin at iago.org> wrote:
>
>Unless I'm misunderstanding the question, threading.Event is the answer.
>
>I've wrapped Queues with Events before, and it makes things a little
>nicer.  It is quite straightforward to make a Queue that exposes a
>get method that will simply block until an Event is set by another
>thread or an optional timeout has elapsed.
>
>It doesn't solve the whole problem, but waiting on an Event is much
>nicer than a get/sleep loop.

Nicer how?  A timed-out Event *is* a get/sleep loop, and if you're not
using a timed-out Event, the blocking Queue.get() should suffice.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

What if there were no rhetorical questions?



More information about the Python-list mailing list