python threading

Alex Martelli aleax at aleax.it
Tue Apr 16 13:42:37 EDT 2002


On Tuesday 16 April 2002 07:35 pm, Justin Sheehy wrote:
	...
> 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.

Yes, but a GUI thread can't do that either -- nor can a network one;
they must be ready for user-input events and netword-data-arriving
events too.  The problem is how to seamlessly merge waiting for
THOSE kinds of things and for Python-thread-stuff kinds...


Alex





More information about the Python-list mailing list