Title: Add concurrent.futures.InterpreterPoolExecutor · Issue #124694 · python/cpython · GitHub
Open Graph Title: Add concurrent.futures.InterpreterPoolExecutor · Issue #124694 · python/cpython
X Title: Add concurrent.futures.InterpreterPoolExecutor · Issue #124694 · python/cpython
Description: 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!) M...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/python/cpython/issues/124694
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add concurrent.futures.InterpreterPoolExecutor","articleBody":"# Feature or enhancement\r\n\r\n### Proposal:\r\n\r\nWhile we wait on [PEP 734](https://peps.python.org/pep-0734/), 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!)\r\n\r\nMy planned design:\r\n\r\n* mostly built on top of `ThreadPoolExecutor`\r\n* callables (and args) passed as initializer or to `submit()` or `map()` will be pickled (same as `ProcessPoolExecutor`)\r\n* initializer and `submit()` arg can be a script instead of a callable (a script for `map()` doesn't make sense since there are no args)\r\n* `__init__()` will take a new \"shared\" arg that corresponds to what `Interpreter.prepare_main()` takes in PEP 734, to allow each worker interpreter to share some data\r\n\r\nIn 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.\r\n\r\nOpen questions:\r\n\r\n* reconstitute and raise uncaught exceptions from running in the interpreter (like we do for `ProcessPoolExecutor`)?\r\n* (optionally?) exec functions against __main__ instead of the their original module, i.e. use the body of the function as a script?\r\n\r\nCC @brianquinlan\r\n\r\n### Has this already been discussed elsewhere?\r\n\r\nThis is a minor feature, which does not need previous discussion elsewhere\r\n\r\n### Links to previous discussion of this feature:\r\n\r\n_No response_\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-124548\r\n* gh-125708\n* gh-134321\n* gh-140468\n* gh-140605\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2024-09-27T18:19:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/124694/cpython/issues/124694"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6fa3fe0d-57fd-b631-c5bd-47a283822e9c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BFA:273B39:16A48A2:1DDA80A:696B8081 |
| html-safe-nonce | dc0469c1c1f94af30da47e745fdd6a98bbc6874758988d63c6a31d43291e0bd5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkZBOjI3M0IzOToxNkE0OEEyOjFEREE4MEE6Njk2QjgwODEiLCJ2aXNpdG9yX2lkIjoiNzY2MzcxMDE3MzIzODM2MjI0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 29590c702589bc2e4cdf28fbe01ebf26bacefa15da391fb85f28ee5fa378aff3 |
| hovercard-subject-tag | issue:2553488515 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/124694/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b212028c481111b43ddc7e6600ab5b43875760112b18f0a09ef1154c42b41ab5/python/cpython/issues/124694 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b212028c481111b43ddc7e6600ab5b43875760112b18f0a09ef1154c42b41ab5/python/cpython/issues/124694 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ericsnowcurrently |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width