summaryrefslogtreecommitdiffstats
path: root/Lib/concurrent
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35279: reduce default max_workers of ThreadPoolExecutor (GH-13618)Inada Naoki2019-05-281-3/+8
|
* bpo-24882: Let ThreadPoolExecutor reuse idle threads before creating new ↵Sean2019-05-221-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thread (#6375) * Fixes issue 24882 * Add news file entry for change. * Change test_concurrent_futures.ThreadPoolShutdownTest Adjust the shutdown test so that, after submitting three jobs to the executor, the test checks for less than three threads, instead of looking for exactly three threads. If idle threads are being recycled properly, then we should have less than three threads. * Switched idle count to semaphor, Updated tests As suggested by reviewer tomMoral, swapped lock-protected counter with a semaphore to track the number of unused threads. Adjusted test_threads_terminate to wait for completiton of the previous future before submitting a new one (and checking the number of threads used). Also added a new test to confirm the thread pool can be saturated. * Updates tests as requested by pitrou. * Correct minor whitespace error. * Make test_saturation faster
* bpo-33110: Catch errors raised when running add_done_callback on already ↵Sam Martin2019-05-221-1/+4
| | | | | | completed futures (GH-13141) Wrap the callback call within the `add_done_callback` function within concurrent.futures, in order to behave in an identical manner to callbacks added to a running future are triggered once it has completed.
* bpo-26903: Limit ProcessPoolExecutor to 61 workers on Windows (GH-13132)Brian Quinlan2019-05-081-0/+14
| | | | Co-Authored-By: brianquinlan <brian@sweetapp.com>
* Don't import wait from connection, it shadows a name (GH-13112)Brian Quinlan2019-05-071-2/+2
| | | (lint cleanup) This import causes an argument parameter to shadow the global import name.
* bpo-36542: Allow to overwrite the signature for Python functions. (GH-12705)Serhiy Storchaka2019-05-063-0/+3
|
* Correct grammar in concurrent/futures/process.py docstring (GH-12761)Thomas Grainger2019-04-121-1/+1
|
* bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)Serhiy Storchaka2019-04-013-3/+46
| | | | | | | | | | | | | | | | | | | | | | Deprecated passing the following arguments as keyword arguments: - "func" in functools.partialmethod(), weakref.finalize(), profile.Profile.runcall(), cProfile.Profile.runcall(), bdb.Bdb.runcall(), trace.Trace.runfunc() and curses.wrapper(). - "function" in unittest.addModuleCleanup() and unittest.TestCase.addCleanup(). - "fn" in the submit() method of concurrent.futures.ThreadPoolExecutor and concurrent.futures.ProcessPoolExecutor. - "callback" in contextlib.ExitStack.callback(), contextlib.AsyncExitStack.callback() and contextlib.AsyncExitStack.push_async_callback(). - "c" and "typeid" in the create() method of multiprocessing.managers.Server and multiprocessing.managers.SharedMemoryServer. - "obj" in weakref.finalize(). Also allowed to pass arbitrary keyword arguments (even "self" and "func") if the above arguments are passed as positional argument.
* bpo-35715: Liberate return value of _process_worker (GH-11514)Dave Chevell2019-03-161-0/+1
| | | | ProcessPoolExecutor workers will hold the return value of their last task in memory until the next task is received. Since the return value has already been propagated to the parent process's Future (or has been discarded by this point), the object can be safely released.
* bpo-35133: Fix mistakes when concatenate string literals on different lines. ↵Serhiy Storchaka2018-11-051-1/+1
| | | | | | | | | | (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
* bpo-34819: Use a monotonic clock to compute timeouts in concurrent.futures ↵orlnub1232018-09-271-4/+4
| | | | | | | (GH-9599) Use a monotonic clock to compute timeouts in :meth:`Executor.map` and :func:`as_completed`, in order to prevent timeouts from deviating when the system clock is adjusted. This may not be sufficient on all systems. On POSIX for example, the actual waiting (e.g. in ``sem_timedwait``) is specified to rely on the CLOCK_REALTIME clock.
* bpo-33238: Add InvalidStateError to concurrent.futures. (GH-7056)jhaydaman2018-05-302-0/+9
| | | | | | | Future.set_result and Future.set_exception now raise InvalidStateError if the futures are not pending or running. This mirrors the behavior of asyncio.Future, and prevents AssertionErrors in asyncio.wrap_future when set_result is called multiple times.
* bpo-33097: Fix submit accepting callable after executor shutdown by ↵Mark Nemec2018-04-102-0/+14
| | | | | | interpreter exit (GH-6144) Executors in concurrent.futures accepted tasks after executor was shutdown by interpreter exit. Tasks were left in PENDING state forever. This fix changes submit to instead raise a RuntimeError.
* bpo-33056 FIX leaking fd in concurrent.futures.ProcessPoolExecutor (#6084)Thomas Moreau2018-03-121-2/+9
|
* bpo-32596: Make lazy-load portable (GH-5316)INADA Naoki2018-01-261-4/+6
| | | | Global variables should not used as import target. Use temporary variable instead.
* bpo-32596: Lazy import concurrent.futures.process and thread (GH-5241)INADA Naoki2018-01-201-2/+33
|
* bpo-32576: use queue.SimpleQueue in critical places (#5216)Antoine Pitrou2018-01-181-1/+1
| | | | Where a queue may be invoked from a weakref callback, we need to use the reentrant SimpleQueue.
* bpo-31699 Deadlocks in `concurrent.futures.ProcessPoolExecutor` with ↵Thomas Moreau2018-01-051-49/+159
| | | | | | pickling error (#3895) Fix deadlocks in :class:`concurrent.futures.ProcessPoolExecutor` when task arguments or results cause pickling or unpickling errors. This should make sure that calls to the :class:`ProcessPoolExecutor` API always eventually return.
* bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241)Antoine Pitrou2017-11-044-10/+84
| | | | | | * bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor * Fix docstring
* bpo-31540: Allow passing multiprocessing context to ProcessPoolExecutor (#3682)Thomas Moreau2017-10-031-29/+37
|
* bpo-31641: Allow arbitrary iterables in `concurrent.futures.as_completed()` ↵Łukasz Langa2017-09-291-2/+1
| | | | | | | (#3830) This was possible before. GH-1560 introduced a regression after 3.6.2 got released where only sequences were accepted now. This commit addresses this problem.
* Fix a c.f.as_completed() refleak previously introduced in bpo-27144 (#3270)Antoine Pitrou2017-09-031-7/+19
|
* bpo-31326: ProcessPoolExecutor waits for the call queue thread (#3265)Victor Stinner2017-09-011-1/+5
| | | | | | | | | | * bpo-31326: ProcessPoolExecutor waits for the call queue thread concurrent.futures.ProcessPoolExecutor.shutdown() now explicitly closes the call queue. Moreover, shutdown(wait=True) now also join the call queue thread, to prevent leaking a dangling thread. * Fix for shutdown() being called twice.
* bpo-27144: concurrent.futures as_complete and map iterators do not keep ↵Grzegorz Grzywacz2017-09-012-10/+41
| | | | | | | | | | reference to returned object (#1560) * bpo-27144: concurrent.futures as_complie and map iterators do not keep reference to returned object * Some nits. Improve wordings in docstrings and comments, and avoid relying on sys.getrefcount() in tests.
* bpo-31249: Fix ref cycle in ThreadPoolExecutor (#3178)Victor Stinner2017-08-221-2/+4
| | | | | | | | | | | | | * bpo-31249: Fix ref cycle in ThreadPoolExecutor concurrent.futures: WorkItem.run() used by ThreadPoolExecutor now breaks a reference cycle between an exception object and the WorkItem object. ThreadPoolExecutor.shutdown() now also clears its threads set. * shutdown() now only clears threads if wait is true. * Revert changes on shutdown()
* bpo-29212: Fix the ugly repr() ThreadPoolExecutor thread name. (#2315)Gregory P. Smith2017-06-221-1/+7
| | | | | | | bpo-29212: Fix the ugly ThreadPoolExecutor thread name. Fixes the newly introduced ugly default thread name for concurrent.futures thread.ThreadPoolExecutor threads. They'll now resemble the old <=3.5 threading default Thread-x names by being named ThreadPoolExecutor-y_n.
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-302-2/+2
|
* Issue #27664: Add to concurrent.futures.thread.ThreadPoolExecutor()Gregory P. Smith2016-08-071-3/+8
| | | | the ability to specify a thread name prefix.
* Issue #25523: Further a-to-an corrections new in 3.5Martin Panter2015-11-021-1/+1
|
* Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-021-1/+1
|\
| * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | Issue #21817: When an exception is raised in a task submitted to a ↵Antoine Pitrou2015-01-171-2/+24
| | | | | | | | | | | | ProcessPoolExecutor, the remote traceback is now displayed in the parent process. Patch by Claudiu Popa.
* | Issue #11271: concurrent.futures.Executor.map() now takes a *chunksize*Antoine Pitrou2014-10-042-1/+56
| | | | | | | | | | argument to allow batching of tasks in child processes and improve performance of ProcessPoolExecutor. Patch by Dan O'Reilly.
* | Closes #21527: Add default number of workers to ThreadPoolExecutor. (Claudiu ↵Guido van Rossum2014-09-021-1/+6
| | | | | | | | Popa.)
* | Issue #22033: Reprs of most Python implemened classes now contain actualSerhiy Storchaka2014-07-251-6/+9
| | | | | | | | class name instead of hardcoded one.
* | Issue #21362: concurrent.futures does not validate that max_workers is properBrian Quinlan2014-05-172-0/+6
|/
* Issue #20319: concurrent.futures.wait() can block forever even if Futures ↵Brian Quinlan2014-02-011-2/+4
| | | | have completed
* Fix issue #20367: concurrent.futures.as_completed() for duplicate arguments.Guido van Rossum2014-01-261-2/+4
| | | | Patch by Glenn Langford.
* Fix import of SimpleQueue.Richard Oudkerk2013-10-161-1/+2
|
* #18741: merge with 3.3.Ezio Melotti2013-08-171-2/+2
|\
| * #18741: fix more typos. Patch by Févry Thibault.Ezio Melotti2013-08-171-2/+2
| |
* | Issue #17914: Use os.cpu_count() instead of multiprocessing.cpu_count() whereCharles-François Natali2013-06-281-1/+1
| | | | | | | | applicable.
* | Merge 3.3, issue #17047: remove doubled words found in 2.7 toTerry Jan Reedy2013-03-111-1/+1
|\ \ | |/ | | | | 3.4 Lib/*, as reported by Serhiy Storchaka and Matthew Barnett.
| * Merge 3.2, issue #17047: remove doubled words found in 2.7 toTerry Jan Reedy2013-03-111-1/+1
| |\ | | | | | | | | | 3.4 Lib/*, as reported by Serhiy Storchaka and Matthew Barnett.
| | * Issue #17047: remove doubled words found in 2.7 to 3.4 Lib/*,Terry Jan Reedy2013-03-111-1/+1
| | | | | | | | | | | | as reported by Serhiy Storchaka and Matthew Barnett.
| * | Fix docstring typo in concurrent.futures.FutureEli Bendersky2013-01-171-1/+1
| | |
* | | Fix docstring typo in concurrent.futures.FutureEli Bendersky2013-01-171-1/+1
| | |
* | | Issue #16284: Prevent keeping unnecessary references to worker functions in ↵Andrew Svetlov2012-11-032-0/+6
| | | | | | | | | | | | concurrent.futures ThreadPoolExecutor.
* | | Fix concurrent.futures docstring typo: "Request Q" -> "Result Q".Mark Dickinson2012-10-201-1/+1
| | |
* | | utilize yield fromPhilip Jenvey2012-10-011-2/+1
|/ /