gh-127989: C API: Refer to attached thread states instead of the GIL by ZeroIntensity · Pull Request #127990 · python/cpython · GitHub
Skip to content

gh-127989: C API: Refer to attached thread states instead of the GIL - #127990

Merged
encukou merged 76 commits into
python:mainfrom
ZeroIntensity:clarify-gil-tstate
Mar 20, 2025
Merged

encukou merged 76 commits into
python:mainfrom
ZeroIntensity:clarify-gil-tstate

Conversation

@ZeroIntensity

@ZeroIntensity ZeroIntensity commented Dec 16, 2024

Copy link
Copy Markdown
Member

As I said in the issue, this is a big change, but it should help clear things up for users. Any feedback, or pointing out flaws, is definitely appreciated!


📚 Documentation preview 📚: https://cpython-previews--127990.org.readthedocs.build/

@ZeroIntensity

Copy link
Copy Markdown
Member Author

@bedevere-app

bedevere-app Bot commented Feb 12, 2025

Copy link
Copy Markdown

Nobody expects the Spanish Inquisition!

@ericsnowcurrently: please review the changes made to this pull request.

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm fine with "attached thread state" and "active thread state".

@encukou encukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; I'll merge ~tomorrow if there are no objections.

IMO, it's fine to have C API details in the glossary for terms related to the C API -- which these are.

My main worry is that per the SC's pronouncement on PEP 703, all changes related to free-threading should be revertable. Unfortunately, we can't really put #ifs in the docs, so the revert will need to start with a manual search for "free-threading".
But, I expect the term "attached thread state" -- and so, the bulk of the changes here -- to stay even if nogil needs to be abandoned for some reason.

@encukou

encukou commented Mar 19, 2025

Copy link
Copy Markdown
Member

Oh, I missed the change request (is it just me or were these more prominent not that long ago?)

@ericsnowcurrently, do you want to block this iteration?

@ericsnowcurrently

Copy link
Copy Markdown
Member

No real objections; I defer to you, Victor and Alyssa.

@vstinner

vstinner commented Mar 20, 2025

Copy link
Copy Markdown
Member

I already approved the PR :-)

@encukou

encukou commented Mar 20, 2025

Copy link
Copy Markdown
Member

@encukou
encukou merged commit 86d5fa9 into python:main Mar 20, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Mar 20, 2025
@ZeroIntensity
ZeroIntensity deleted the clarify-gil-tstate branch March 20, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants