Skip to content

Clarifying the PyGILState_ API for per-GIL subinterpreters #123672

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

Closed
ZeroIntensity opened this issue Sep 4, 2024 · 0 comments
Closed

Clarifying the PyGILState_ API for per-GIL subinterpreters #123672

ZeroIntensity opened this issue Sep 4, 2024 · 0 comments
Labels

Comments

@ZeroIntensity
Copy link
Member

ZeroIntensity commented Sep 4, 2024

Documentation

Both #123488 and #123134 have made it clear that PEP-684 and multithreading from C haven't been documented properly. In both issues, the following line was misinterpreted:

Python supports the creation of additional interpreters (using Py_NewInterpreter()), but mixing multiple interpreters and the PyGILState_* API is unsupported.

This has been interpreted as "it's safe to call Py_NewInterpreter (or Py_NewInterpreterFromConfig) without the GIL," which it definitely is not! It's just that we can't switch interpreters via PyGILState_* -- that should be clarified.

(@encukou, this needs topic-subinterpreters)

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

4 participants
@mdboom @ZeroIntensity @Eclips4 and others