changeset: 104629:785597e758a1 branch: 3.5 parent: 104626:0b5e28042355 user: Yury Selivanov date: Fri Oct 21 17:40:42 2016 -0400 files: Doc/library/asyncio-eventloop.rst Lib/asyncio/base_events.py Misc/NEWS description: Issue #26796: Don't configure the number of workers for default threadpool executor. Initial patch by Hans Lawrenz. diff -r 0b5e28042355 -r 785597e758a1 Doc/library/asyncio-eventloop.rst --- a/Doc/library/asyncio-eventloop.rst Fri Oct 21 14:30:50 2016 -0700 +++ b/Doc/library/asyncio-eventloop.rst Fri Oct 21 17:40:42 2016 -0400 @@ -670,6 +670,13 @@ This method is a :ref:`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 -r 0b5e28042355 -r 785597e758a1 Lib/asyncio/base_events.py --- a/Lib/asyncio/base_events.py Fri Oct 21 14:30:50 2016 -0700 +++ b/Lib/asyncio/base_events.py Fri Oct 21 17:40:42 2016 -0400 @@ -41,9 +41,6 @@ __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 @@ 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 -r 0b5e28042355 -r 785597e758a1 Misc/NEWS --- a/Misc/NEWS Fri Oct 21 14:30:50 2016 -0700 +++ b/Misc/NEWS Fri Oct 21 17:40:42 2016 -0400 @@ -402,6 +402,10 @@ 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 ----