-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
bpo-20891: Py_Initialize() now creates the GIL #4700
Conversation
@@ -0,0 +1,2 @@ | |||
Py_Initialize() now creates the GIL. The GIL is not more created "on demand" to |
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.
s/not more/no more/
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.
oops, replaced with "no longer"
Is there any documentation to update? |
Done, see my updated PR. |
Doc/c-api/init.rst
Outdated
@@ -818,54 +817,39 @@ code, or when embedding the Python interpreter: | |||
|
|||
This is a no-op when called for a second time. | |||
|
|||
.. versionchanged:: 3.7 | |||
The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`. |
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 would phrase it more explicitly:
This function is now called by :c:func:`Py_Initialize()`, so you don't have to call it yourself anymore.
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.
done
This branch seems to fix the issue for me on macOS 10.12.6 |
For benchmark results, see https://bugs.python.org/issue20891#msg308588 |
The GIL is no longer created "on demand" to fix a race condition when PyGILState_Ensure() is called in a non-Python thread.
Remove also mention of the "thread support", since thread support cannot be disabled anymore.
Make the assumption that the GIL is always created (by Py_Initialize()).
@vstinner: Please replace |
The GIL is not more created "on demand" to fix a race condition when
PyGILState_Ensure() is called in a non-Python thread.
https://bugs.python.org/issue20891