]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-124694: Add concurrent.futures.InterpreterPoolExecutor (gh-124548)
authorEric Snow <ericsnowcurrently@gmail.com>
Wed, 16 Oct 2024 22:50:46 +0000 (16:50 -0600)
committerGitHub <noreply@github.com>
Wed, 16 Oct 2024 22:50:46 +0000 (16:50 -0600)
commita5a7f5e16d8c3938d266703ea8fba8ffee3e3ae5
tree8f35555767598b877e490814eca9363cdf5eea2d
parenta38fef4439139743e3334c1d69f24cafdf4d71da
gh-124694: Add concurrent.futures.InterpreterPoolExecutor (gh-124548)

This is an implementation of InterpreterPoolExecutor that builds on ThreadPoolExecutor.

(Note that this is not tied to PEP 734, which is strictly about adding a new stdlib module.)

Possible future improvements:

* support passing a script for the initializer or to submit()
* support passing (most) arbitrary functions without pickling
* support passing closures
* optionally exec functions against __main__ instead of the their original module
12 files changed:
Doc/library/asyncio-dev.rst
Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-llapi-index.rst
Doc/library/concurrent.futures.rst
Doc/whatsnew/3.14.rst
Lib/concurrent/futures/__init__.py
Lib/concurrent/futures/interpreter.py [new file with mode: 0644]
Lib/concurrent/futures/thread.py
Lib/test/test_concurrent_futures/executor.py
Lib/test/test_concurrent_futures/test_interpreter_pool.py [new file with mode: 0644]
Lib/test/test_concurrent_futures/util.py
Misc/NEWS.d/next/Library/2024-09-27-15-42-55.gh-issue-124694.uUy32y.rst [new file with mode: 0644]