Not fully understanding the role of Queue.task_done()
Fredrik Lundh
fredrik at pythonware.com
Thu Sep 4 15:41:33 EDT 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.
</F>
More information about the Python-list
mailing list