Queue.Queue-like class without the busy-wait

Antoon Pardon apardon at forel.vub.ac.be
Fri Mar 25 04:22:51 EST 2005


Op 2005-03-25, Paul Rubin schreef <http>:
> 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?

And how is this semaphore going to be released if the timeout is
reached?

-- 
Antoon Pardon



More information about the Python-list mailing list