alternative to JoinableQueue's please
python at rcn.com
Fri Jun 26 17:44:16 EDT 2009
> The reasons for using JoinableQueue I think are obvious. I want to
> block the main processing using queue.join() until the tasks that have
> been placed on the queue have been finished by the worker processes.
> I can't be the only one experiencing this (besides Brian)... are there
> others who ran into this? Are there work arounds (besides a
> home-brewed one) ?
Before Queue.task_done() and Queue.task_join() were added, other
idioms were used.
One technique is to use a second queue to track incomplete tasks.
# adding work
# doing work
t = q.get()
# waiting for unfinished tasks to complete
More information about the Python-list