Why does Queue.Queue
have a task_done
method while multiprocessing.Queue
has no such method?
Why does multiprocessing.Queue have no task_done method
4.2k views Asked by Baz At
2
There are 2 answers
0
On
My guess would be: multithreading
module was implemented very early, multiprocessing
module came in 2.6 version.
The queue design was slightly corrected for multiprocessing
and offers better flexibility than the multithreading
, because you can choose between Queue
, SimpleQueue
and JoinableQueue
depending on your use cases (speed vs reliability).
Now modifing multithreading
like this would have caused backwards incompatibility, since join
and task_done
methods would have to be removed. Imagine the code needed to be refactored, new tests had to be written, API broken - for me clearly no benefits.
I think you need JoinableQueue.