๐ŸŒ
Anthony Shaw
tonybaloney.github.io โ€บ posts โ€บ sub-interpreter-web-workers.html
Running Python Parallel Applications with Sub Interpreters
November 17, 2023 - class SubinterpreterWorker(threading.Thread): def __init__(self, number: int, config: Config, sockets: Sockets): self.worker_number = number self.interp = interpreters.create() self.channel = channels.create() self.config = config # TODO copy other parameters from config self.sockets = sockets super().__init__(target=self.run, daemon=True) def run(self): # Convert insecure sockets to a tuple of tuples because the Sockets type cannot be shared insecure_sockets = [] for s in self.sockets.insecure_sockets: insecure_sockets.append((int(s.family), int(s.type), s.proto, s.fileno())) interpreters.run
๐ŸŒ
Real Python
realpython.com โ€บ python312-subinterpreters
Python 3.12 Preview: Subinterpreters โ€“ Real Python
May 3, 2024 - In this tutorial, you'll preview one of the upcoming features of Python 3.12 and a proposed change to Python 3.13, addressing how subinterpreters work in the CPython program. The changes are described in PEP 684 and PEP 554.
Discussions

Python 3.12 Preview: Subinterpreters โ€“ Real Python
registation wall, can't read the article More on reddit.com
๐ŸŒ r/Python
30
141
September 26, 2023
What are the differences between Python 3.12 sub-interpreters and multithreading/multiprocessing?
Basically yes. You can think of it as a more performant multiprocessing. Although the Python interface you mention will only be available in 3.13, for now it's strictly for the C API More on reddit.com
๐ŸŒ r/Python
16
94
October 3, 2023
Expected performance characteristics of subinterpreters
Iโ€™m testing the subinterpreters interface because Iโ€™ll likely be taking advantage of it to improve scaling of this library across multiple threads. Subinterpreters are attractive because: I need more flexible shared memory than multiprocessing can provide. More on discuss.python.org
๐ŸŒ discuss.python.org
0
3
May 14, 2024
Playing around sub-interpreters in 3.14
Hi - I thought that with the first class support for subinterpreters finally in the stdlib, my extrainterpreters pet project would be rendered all but obsolete. Nonetheless, I made a new release this week, changing just (and just) the importing names so that it could function with Python 3.14. More on discuss.python.org
๐ŸŒ discuss.python.org
0
1
October 3, 2025
๐ŸŒ
Readthedocs
pythondev.readthedocs.io โ€บ subinterpreters.html
Python Subinterpreters โ€” Unofficial Python Development (Victor's notes) documentation
Effects of the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro: Good things! Per-interpreter GIL!!! Use a TSS to get the current Python thread state (โ€˜tstateโ€™)
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ concurrent.interpreters.html
concurrent.interpreters โ€” Multiple interpreters in the same process
The module is primarily meant to provide a basic API for managing interpreters (AKA โ€œsubinterpretersโ€) and running things in them.
๐ŸŒ
Python
peps.python.org โ€บ pep-0554
PEP 554 โ€“ Multiple Interpreters in the Stdlib | peps.python.org
See the Examples section for concrete usage and use cases. Along with exposing the existing (in CPython) multiple interpreter support, the module will also support a basic mechanism for passing data between interpreters. That involves setting โ€œshareableโ€ objects in the __main__ module of a target subinterpreter...
๐ŸŒ
ThinhDA
thinhdanggroup.github.io โ€บ subinterpreter
Python 3.12 Subinterpreters: A New Era of Concurrency - ThinhDA
September 23, 2023 - On the other hand, each subinterpreter in Python has its own separate memory space, which can help to avoid these issues. However, this also means that sharing data between subinterpreters can be more complex. For example, subinterpreters can use the interpreters module to share data via channels, while threads can use the threading to share data via locks, queues, or other synchronization primitives.
๐ŸŒ
Changs
blog.changs.co.uk โ€บ subinterpreters-and-asyncio.html
Subinterpreters and Asyncio - Jamie's Blog
August 5, 2025 - My solution for concurrency is almost always async, I've even made a similar case in Free Threaded Python With Asyncio. I am fully aware of how many people in the community dislike async. Unfortunately this is an opinion that could divide the community and is definitely a topic for another day. To marry subinterpreters with asyncio I created the package aiointerpreters. Here's a very basic example:
๐ŸŒ
Python
peps.python.org โ€บ pep-0734
PEP 734 โ€“ Multiple Interpreters in the Stdlib | peps.python.org
November 6, 2023 - In the case that code somewhere else may catch it, it is helpful to identify that the exception came from a subinterpreter (i.e. a โ€œremoteโ€ source), rather than from the current interpreter. Thatโ€™s why Interpreter.exec() raises ExecutionFailed and why it is a plain Exception, rather than a copy or proxy with a class that matches the original exception. For example, an uncaught ValueError from a subinterpreter would never get caught in a later try: ...
Find elsewhere
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ python 3.12 preview: subinterpreters โ€“ real python
r/Python on Reddit: Python 3.12 Preview: Subinterpreters โ€“ Real Python
September 26, 2023 - That seems to suggest that accessing non-python resources is not actually possible, but correct me if I'm wrong. ... I haven't seen an example of this. According to the notes in extrainterpreters, for example, it says that ctypes is not importable with subinterpreters.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ what are the differences between python 3.12 sub-interpreters and multithreading/multiprocessing?
r/Python on Reddit: What are the differences between Python 3.12 sub-interpreters and multithreading/multiprocessing?
October 3, 2023 -

It seems like the new feature in Python 3.12 allows developers to create multiple sub-interpreters within a single main interpreter process. From the example from the PEP 554, sub-interpreters appear to be separate threads that run a dedicated piece of Python code and consequently have their own separate GILs.

interp = interpreters.create()
print('before')
interp.run('print("during")')
print('after')

On practice, is this basically the new Pythonic way to run a single application in multiple threads and take advantage of multiple cores? If yes, can they be thought as multithreading with no shared state and become the future alternative of multiprocessing?

๐ŸŒ
Talk Python To Me
talkpython.fm โ€บ episodes โ€บ show โ€บ 447 โ€บ parallel-python-apps-with-sub-interpreters
Episode #447 - Parallel Python Apps with Sub Interpreters | Talk Python To Me Podcast
February 3, 2024 - Guests Anthony Shaw: @tonybaloney@fosstodon.org Eric Snow: @ericsnowcurrently@mastodon.social PEP 684 โ€“ A Per-Interpreter GIL: peps.python.org PEP 734 โ€“ Multiple Interpreters in the Stdlib: peps.python.org Running Python Parallel Applications with Sub Interpreters: fosstodon.org pytest subinterpreters: fosstodon.org Long-Term Vision for a Parallel Python Programming Model?: fosstodon.org Hypercorn Server: github.com msgspec: jcristharif.com Dill package: pypi.org Watch this episode on YouTube: youtube.com Episode #447 deep-dive: talkpython.fm/447 Episode transcripts: talkpython.fm ---== Don't be a stranger ==--- YouTube: youtube.com/@talkpython Bluesky: @talkpython.fm Mastodon: @talkpython@fosstodon.org X.com: @talkpython Michael on Bluesky: @mkennedy.codes Michael on Mastodon: @mkennedy@fosstodon.org Michael on X.com: @mkennedy
๐ŸŒ
GitHub
github.com โ€บ Sleemanmunk โ€บ python_subinterpreters_example
GitHub - Sleemanmunk/python_subinterpreters_example: An example project of how to use subinterpreters in the lastest version of the Python C API without threads
An example project of how to use subinterpreters in the lastest version of the Python C API without threads - Sleemanmunk/python_subinterpreters_example
Author ย  Sleemanmunk
๐ŸŒ
LWN.net
lwn.net โ€บ Articles โ€บ 820424
Subinterpreters for Python [LWN.net]
May 13, 2020 - Eric Snow's PEP 554 ("Multiple Interpreters in the Stdlib") would expose the existing subinterpreter support from the C API in the standard library. That would allow Python programs to use multiple separate interpreters; the PEP also proposes to add a way to share some data types between the instances.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ c-api โ€บ subinterpreters.html
Multiple interpreters in a Python process โ€” Python 3.14.3 documentation
3 weeks ago - Because sub-interpreters (and the main interpreter) are part of the same process, the insulation between them isnโ€™t perfect โ€” for example, using low-level file operations like os.close() they can (accidentally or maliciously) affect each otherโ€™s open files.
๐ŸŒ
GitHub
github.com โ€บ jsbueno โ€บ extrainterpreters
GitHub - jsbueno/extrainterpreters: Utilities for using Python's PEP 554 subinterpreters
Still, at the eve of Python 3.14, I am issuing an small update so that the API as avaliable up to Python 3.13 is imported from the right place, and the structures in this project work. Just import "extrainterpreters" and use the Interpreter class as a wrapper to the subinterpreter represented by a single integer handle created by the new interpreters module:
Starred by 122 users
Forked by 8 users
Languages ย  Python 96.8% | C 3.2% | Python 96.8% | C 3.2%
๐ŸŒ
Python.org
discuss.python.org โ€บ python help
Expected performance characteristics of subinterpreters - Python Help - Discussions on Python.org
May 14, 2024 - Iโ€™m testing the subinterpreters interface because Iโ€™ll likely be taking advantage of it to improve scaling of this library across multiple threads. Subinterpreters are attractive because: I need more flexible shared meโ€ฆ
๐ŸŒ
Vstinner
vstinner.github.io โ€บ cpython-pass-tstate.html
Pass the Python thread state explicitly โ€” Victor Stinner blog 3
January 8, 2020 - As explained above, another example is gilstate that should also be moved to PyInterpreterState, but that's a complex change that should be well prepared to not break anything. Implementing subinterpreters also requires to cleanup various parts of Python internals.
๐ŸŒ
Python.org
discuss.python.org โ€บ python help
Playing around sub-interpreters in 3.14 - Python Help - Discussions on Python.org
October 3, 2025 - Hi - I thought that with the first class support for subinterpreters finally in the stdlib, my extrainterpreters pet project would be rendered all but obsolete. Nonetheless, I made a new release this week, changing just (and just) the importing names so that it could function with Python 3.14.