Docs: C API: Improve documentation around non-Python threads with subinterpreters#131087
Merged
encukou merged 5 commits intopython:mainfrom May 17, 2025
Merged
Conversation
Contributor
|
I can make backport if review passes |
encukou
reviewed
Mar 18, 2025
Member
Author
|
I'll deal with resolving conflicts later today. |
encukou
reviewed
Mar 24, 2025
Member
Author
|
I've opted to not backport this because we're using thread state terms now. |
Contributor
|
ok :)
…On Mon, Mar 24, 2025 at 10:44 AM Peter Bierma ***@***.***> wrote:
I've opted to not backport this because we're using thread state terms now.
—
Reply to this email directly, view it on GitHub
<#131087 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNITW56N5GH66FQNT6MXOHT2WAK6FAVCNFSM6AAAAABYY2QLM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBYGM3TQNZSGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: ZeroIntensity]*ZeroIntensity* left a comment
(python/cpython#131087)
<#131087 (comment)>
I've opted to not backport this because we're using thread state terms now.
—
Reply to this email directly, view it on GitHub
<#131087 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNITW56N5GH66FQNT6MXOHT2WAK6FAVCNFSM6AAAAABYY2QLM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBYGM3TQNZSGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Member
Author
|
@encukou I forgot about this one. Would you mind finishing up your review when you have some time? |
vstinner
reviewed
May 5, 2025
Co-authored-by: Victor Stinner <[email protected]>
|
Thanks @ZeroIntensity for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
May 17, 2025
…interpreters (pythonGH-131087) (cherry picked from commit af6b3b8) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
Member
|
Just did. Sorry for the delay! |
|
GH-134130 is a backport of this pull request to the 3.14 branch. |
encukou
pushed a commit
that referenced
this pull request
May 17, 2025
…ith subinterpreters (GH-131087) (GH-134130) Docs: C API: Improve documentation around non-Python threads with subinterpreters (GH-131087) (cherry picked from commit af6b3b8) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
Pranjal095
pushed a commit
to Pranjal095/cpython
that referenced
this pull request
Jul 12, 2025
…interpreters (pythonGH-131087) Co-authored-by: Victor Stinner <[email protected]>
taegyunkim
pushed a commit
to taegyunkim/cpython
that referenced
this pull request
Aug 4, 2025
…interpreters (pythonGH-131087) Co-authored-by: Victor Stinner <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@da-woods's comment inspired me to improve some of the documentation here. This should play pretty nicely with the incoming
PyThreadState_EnsureAPI, and with GH-127990 whenever that gets merged.PyThreadState *to support subinterpreters in a non-Python thread.PyGILState_Ensure's note to a warning, and mention that it can actually crash the interpreter. (See Debug build assertion failure with native threads attempting to acquire GIL on termination #131012 and PyGILStateEnsure() (Probably) Crashes If Called After Finalization #124619.)PyGILState_Checkalways returns 1 if subinterpreters are enabled.PyGILState_GetThisThreadStatedoesn't account for non-GILStatethread states.PyThreadState_Swapwill also hang the thread during finalization (but unlikeGILState, it shouldn't crash).📚 Documentation preview 📚: https://cpython-previews--131087.org.readthedocs.build/en/131087/c-api/init.html#supporting-subinterpreters-in-non-python-threads