[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

Antoine Pitrou report at bugs.python.org
Fri Apr 13 16:04:38 EDT 2018


Antoine Pitrou <pitrou at free.fr> added the comment:

> That said, if threads are cheap, why not just create all the work threads on initialization, and then remove all the logic entirely?

That would sound reasonable to me.  bquinlan has been absent for a long time, so I wouldn't expect an answer from him on this issue.

> Also, regarding the executor and thread-safety, there's an example in the current docs showing a job being added to the executor from a worker thread

Actually, looking at the code again, submit() is protected by the shutdown_lock, so it seems it should be thread-safe.  That's on git master btw.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24882>
_______________________________________


More information about the Python-bugs-list mailing list