-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
gh-109549: Add new states to PyThreadState to support PEP 703 #109915
Conversation
This adds a new field 'state' to PyThreadState that can take on one of three values: _Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, and _Py_THREAD_GC. The "attached" and "detached" states correspond closely to closely to acquiring and releasing the GIL. The "gc" state is current unused, but will be used to implement stop-the-world GC for `--disable-gil` builds in the near future.
!buildbot nogil |
The regex 'nogil' did not match any buildbot builder.Is the requested builder in the list of stable builders? |
!buildbot GIL |
The regex 'GIL' did not match any buildbot builder.Is the requested builder in the list of stable builders? |
@@ -2095,12 +2092,11 @@ new_interpreter(PyThreadState **tstate_p, const PyInterpreterConfig *config) | |||
*tstate_p = NULL; | |||
|
|||
/* Oops, it didn't work. Undo it all. */ | |||
PyErr_PrintEx(0); |
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.
I removed the PyErr_PrintEx(0)
call, which never printed anything (failures are reported via PyStatus) and was also unsafe to call in some cases when the current thread did not hold the GIL.
@ericsnowcurrently, would you please review this when you get a chance? |
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.
There are a couple of comments that I'd like preserved, but otherwise LGTM.
I've merged the 'main' branch into this PR to resolve merge conflicts. |
@colesbury, I'm going to merge this. Please keep an eye on the buildbots. |
…ythongh-109915) This adds a new field 'state' to PyThreadState that can take on one of three values: _Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, or _Py_THREAD_GC. The "attached" and "detached" states correspond closely to acquiring and releasing the GIL. The "gc" state is current unused, but will be used to implement stop-the-world GC for --disable-gil builds in the near future.
This adds a new field 'state' to PyThreadState that can take on one of three values:
_Py_THREAD_ATTACHED
,_Py_THREAD_DETACHED
, or_Py_THREAD_GC
. The "attached" and "detached" states correspond closely to closely to acquiring and releasing the GIL. The "gc" state is current unused, but will be used to implement stop-the-world GC for--disable-gil
builds in the near future.ATTACHED
,DETACHED
,GC
toPyThreadState
to support PEP 703 #109549