-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Add concurrent.futures.InterpreterPoolExecutor #124694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
3.14
bugs and security fixes
stdlib
Python modules in the Lib dir
topic-subinterpreters
type-feature
A feature request or enhancement
Comments
ericsnowcurrently
added a commit
that referenced
this issue
Oct 16, 2024
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
ericsnowcurrently
added a commit
that referenced
this issue
Oct 18, 2024
…olicy During Cleanup (gh-125708) This resolves a failure on the android buildbot.
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this issue
Jan 12, 2025
…ongh-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
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this issue
Jan 12, 2025
…Loop Policy During Cleanup (pythongh-125708) This resolves a failure on the android buildbot.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.14
bugs and security fixes
stdlib
Python modules in the Lib dir
topic-subinterpreters
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
While we wait on PEP 734, there's nothing blocking us from adding a new executor for multiple interpreters. Doing so would allow people to start trying them out. (I wish I had thought of this for 3.13!)
My planned design:
ThreadPoolExecutor
submit()
ormap()
will be pickled (same asProcessPoolExecutor
)submit()
arg can be a script instead of a callable (a script formap()
doesn't make sense since there are no args)__init__()
will take a new "shared" arg that corresponds to whatInterpreter.prepare_main()
takes in PEP 734, to allow each worker interpreter to share some dataIn the future we could support a more efficient "sharing" scheme than pickle. When (or if) PEP 734 is accepted, we can refactor the executor to use the
interpreters
module rather than using_interpreters
directly.Open questions:
ProcessPoolExecutor
)?CC @brianquinlan
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: