Queue.Queue-like class without the busy-wait

Paul Rubin http
Fri Mar 25 03:50:24 EST 2005


Antoon Pardon <apardon at forel.vub.ac.be> writes:
> I started once, using the Timer class in the Threading Module to
> break the lock. However the Timer class uses the same kind of
> sleep-polling loop, to delay the exection and allow an intermediate
> cancel, as the loop that is used in Queue.Queue, so that was no
> gain.

I've never checked this code but it wouldn't have occurred to me that
Queue uses any kind of timeout loop.  Can't it work the obvious way
with a semaphore?



More information about the Python-list mailing list