]> granicus.if.org Git - python/commitdiff
Issue #26796: Don't configure the number of workers for default threadpool executor.
authorYury Selivanov <yury@magic.io>
Fri, 21 Oct 2016 21:40:42 +0000 (17:40 -0400)
committerYury Selivanov <yury@magic.io>
Fri, 21 Oct 2016 21:40:42 +0000 (17:40 -0400)
Initial patch by Hans Lawrenz.

Doc/library/asyncio-eventloop.rst
Lib/asyncio/base_events.py
Misc/NEWS

index 202da5ae5bb36bca489f723c12f1f1684d8a638c..ba52d9bed3d5784b796306d266a33c30dc1fab72 100644 (file)
@@ -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`.
index 648b9b9bbc2f5cd516ce4d93f71373f47e201043..b3e318e1b1cc6030620cf96829b1bff25882f353 100644 (file)
@@ -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)
 
index 48bd626c1d7850de072988d8bca13a140c590303..8c091a00ef675c3a8576ef9c5d64ba6d33758a5e 100644 (file)
--- 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
 ----