Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Docs: C API: Improve documentation around non-Python threads with subinterpreters#131087
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Docs: C API: Improve documentation around non-Python threads with subinterpreters#131087
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I can make backport if review passes |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I'll deal with resolving conflicts later today. |
Uh oh!
There was an error while loading.Please reload this page.
I've opted to not backport this because we're using thread state terms now. |
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: ***@***.***> |
@encukou I forgot about this one. Would you mind finishing up your review when you have some time? |
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
af6b3b8
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@ZeroIntensity for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…interpreters (pythonGH-131087)(cherry picked from commitaf6b3b8)Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Victor Stinner <vstinner@python.org>
Just did. Sorry for the delay! |
GH-134130 is a backport of this pull request to the3.14 branch. |
Uh oh!
There was an error while loading.Please reload this page.
@da-woods'scomment inspired me to improve some of the documentation here. This should play pretty nicely with the incoming
PyThreadState_Ensure
API, and withGH-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. (SeeDebug build assertion failure with native threads attempting to acquire GIL on termination #131012 andPyGILStateEnsure() (Probably) Crashes If Called After Finalization #124619.)PyGILState_Check
always returns 1 if subinterpreters are enabled.PyGILState_GetThisThreadState
doesn't account for non-GILState
thread states.PyThreadState_Swap
will 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