Skip to content
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

gh-76785: Handle Legacy Interpreters Properly #117490

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Apr 2, 2024

This is similar to the situation with threading._DummyThread. The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create(). The simplest thing is to disable any method that modifies or runs in the interpreter. As part of this, the runtime keeps track of where an interpreter was created. We also handle interpreter "refcounts" properly.

@ericsnowcurrently ericsnowcurrently force-pushed the hide-legacy-subinterpreters branch from 7de833a to e38f141 Compare April 11, 2024 00:40
@ericsnowcurrently ericsnowcurrently marked this pull request as ready for review April 11, 2024 20:40
@ericsnowcurrently ericsnowcurrently enabled auto-merge (squash) April 11, 2024 22:59
@ericsnowcurrently ericsnowcurrently merged commit fd259fd into python:main Apr 11, 2024
34 checks passed
@ericsnowcurrently ericsnowcurrently deleted the hide-legacy-subinterpreters branch April 11, 2024 23:26
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
This is similar to the situation with threading._DummyThread.  The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create().  The simplest thing to start with is to disable any method that modifies or runs in the interpreter.  As part of this, the runtime keeps track of where an interpreter was created.  We also handle interpreter "refcounts" properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant