Simple thread-safe counter?

Leif K-Brooks eurleif at ecritters.biz
Sat Apr 2 05:18:25 EST 2005


Artie Gold wrote:
> Skip Montanaro wrote:
> 
>>     counter = Queue.Queue()
>>     def f():
>>         i = counter.get()
> 
> I think you need:
>           i = counter.get(True)

The default value for the "block" argument to Queue.get is True.



More information about the Python-list mailing list