mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-35279: reduce default max_workers of ThreadPoolExecutor (GH-13618)
This commit is contained in:
parent
293e9f86b8
commit
9a7e5b1b42
4 changed files with 22 additions and 5 deletions
|
@ -159,6 +159,15 @@ And::
|
|||
.. versionchanged:: 3.7
|
||||
Added the *initializer* and *initargs* arguments.
|
||||
|
||||
.. versionchanged:: 3.8
|
||||
Default value of *max_workers* is changed to ``min(32, os.cpu_count() + 4)``.
|
||||
This default value preserves at least 5 workers for I/O bound tasks.
|
||||
It utilizes at most 32 CPU cores for CPU bound tasks which release the GIL.
|
||||
And it avoids using very large resources implicitly on many-core machines.
|
||||
|
||||
ThreadPoolExecutor now reuses idle worker threads before starting
|
||||
*max_workers* worker threads too.
|
||||
|
||||
|
||||
.. _threadpoolexecutor-example:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue