Skip to content

Conversation

ZeroIntensity
Copy link
Member

@ZeroIntensity ZeroIntensity commented Nov 27, 2024

Releasing the thread state via Py_BEGIN_ALLOW_THREADS can be confusing for users on free-threading, because the common error messages that come up mention that the GIL must be held, but that won't make sense if it's disabled.

(Technically, the part of the new message mentioning Py_BEGIN_ALLOW_THREADS is true for the default build as well, but I don't see enough justification to change it there too.)

@ZeroIntensity
Copy link
Member Author

Apologies for the notification spam with the commits, I'm a bit on the go right now so I had to do it from GH. It's all updated now.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. I like "active thread state" for Free Threading.

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

LGTM as well

@vstinner vstinner merged commit 12680ec into python:main Dec 6, 2024
45 checks passed
@vstinner
Copy link
Member

vstinner commented Dec 6, 2024

Merged, thank you.

@ZeroIntensity ZeroIntensity deleted the nogil-tstate-error-message branch December 6, 2024 16:11
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…state on the free-threaded build (python#127315)

Co-authored-by: Victor Stinner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants