Not fully understanding the role of Queue.task_done()
fredrik at pythonware.com
Thu Sep 4 21:41:33 CEST 2008
Martin DeMello wrote:
> Reading up on python's built in Queue class, though, it seems oriented
> towards "job queues", with a two-step dequeue operation (get() and
> task_done()). I'm worried that this would make it too heavyweight for
> my application. Is ther documentation somewhere on what exactly
> task_done() does, and whether I can disable the tracking of a job once
> it's removed from the queue? The python docs for the Queue module were
> a bit light.
"task_done" just decrements a counter (incremented by "put"). when the
counter reaches zero, the "join" call is unblocked.
More information about the Python-list