-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Add concurrent.futures.InterpreterPoolExecutor #124694
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-subinterpreterstype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-subinterpreterstype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done
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:
ThreadPoolExecutorsubmit()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
interpretersmodule rather than using_interpretersdirectly.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