diff options
author | Guido van Rossum <guido@python.org> | 2014-09-02 17:39:18 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2014-09-02 17:39:18 (GMT) |
commit | cfd4661e78bd2256caaf80cf29588e5119e787b0 (patch) | |
tree | 507008e6f9977acff6a347cc085119c6a7917164 /Doc/library/concurrent.futures.rst | |
parent | 8257b6283e3ea41f5746835871dedcb00139bdfe (diff) | |
download | cpython-cfd4661e78bd2256caaf80cf29588e5119e787b0.zip cpython-cfd4661e78bd2256caaf80cf29588e5119e787b0.tar.gz cpython-cfd4661e78bd2256caaf80cf29588e5119e787b0.tar.bz2 |
Closes #21527: Add default number of workers to ThreadPoolExecutor. (Claudiu Popa.)
Diffstat (limited to 'Doc/library/concurrent.futures.rst')
-rw-r--r-- | Doc/library/concurrent.futures.rst | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst index 08c926a..e487817 100644 --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -115,11 +115,19 @@ And:: executor.submit(wait_on_future) -.. class:: ThreadPoolExecutor(max_workers) +.. class:: ThreadPoolExecutor(max_workers=None) An :class:`Executor` subclass that uses a pool of at most *max_workers* threads to execute calls asynchronously. + .. versionchanged:: 3.5 + If *max_workers* is ``None`` or + not given, it will default to the number of processors on the machine, + multiplied by ``5``, assuming that :class:`ThreadPoolExecutor` is often + used to overlap I/O instead of CPU work and the number of workers + should be higher than the number of workers + for :class:`ProcessPoolExecutor`. + .. _threadpoolexecutor-example: |