[issue29603] More informative Queue class: new method that returns number of unfinished tasks
slytomcat
report at bugs.python.org
Tue Feb 21 10:55:12 EST 2017
slytomcat added the comment:
One more problem that adjusting of number of threads is performed exactly after placing the new task in the queue. In in some cases we can find that qsuze <> 0 but it doesn't mean that there is no idle threads. It can be equal to 1 (just queued task) as no threads manage to get it yet (don't forgot about GIL).
So even qsuze <> 0 dosn't mean that we need to create a new thread.
But (unfinished() <= num_threads) works perfect in this case also.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29603>
_______________________________________
More information about the Python-bugs-list
mailing list