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

Antoine Pitrou report at bugs.python.org
Sun Apr 8 14:42:56 EDT 2018


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

Side note:

> One concern I do have - while writing the patch, I noticed the existing submit method (specifically the adjust_thread_count function) isn't thread safe.

True.  The executor is obviously thread-safe internally (as it handles multiple worker threads).  But the user should not /call/ it from multiple threads.

(most primitives exposed by the Python stdlib are not thread-safe, except for the simplest ones such as lists, dicts etc.)

----------

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


More information about the Python-bugs-list mailing list