summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/asyncio-eventloop.rst7
-rw-r--r--Lib/asyncio/base_events.py5
-rw-r--r--Misc/NEWS4
3 files changed, 12 insertions, 4 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index 202da5a..ba52d9b 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -670,6 +670,13 @@ pool of processes). By default, an event loop uses a thread pool executor
This method is a :ref:`coroutine <coroutine>`.
+ .. versionchanged:: 3.5.3
+ :meth:`BaseEventLoop.run_in_executor` no longer configures the
+ ``max_workers`` of the thread pool executor it creates, instead
+ leaving it up to the thread pool executor
+ (:class:`~concurrent.futures.ThreadPoolExecutor`) to set the
+ default.
+
.. method:: AbstractEventLoop.set_default_executor(executor)
Set the default executor used by :meth:`run_in_executor`.
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 648b9b9..b3e318e 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -41,9 +41,6 @@ from .log import logger
__all__ = ['BaseEventLoop']
-# Argument for default thread pool executor creation.
-_MAX_WORKERS = 5
-
# Minimum number of _scheduled timer handles before cleanup of
# cancelled handles is performed.
_MIN_SCHEDULED_TIMER_HANDLES = 100
@@ -616,7 +613,7 @@ class BaseEventLoop(events.AbstractEventLoop):
if executor is None:
executor = self._default_executor
if executor is None:
- executor = concurrent.futures.ThreadPoolExecutor(_MAX_WORKERS)
+ executor = concurrent.futures.ThreadPoolExecutor()
self._default_executor = executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
diff --git a/Misc/NEWS b/Misc/NEWS
index 48bd626..8c091a0 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -402,6 +402,10 @@ Library
children are done.
Patch by Johannes Ebke.
+- Issue #26796: Don't configure the number of workers for default
+ threadpool executor.
+ Initial patch by Hans Lawrenz.
+
IDLE
----