Skip to content

[3.6] bpo-20891: Py_Initialize() now creates the GIL (#4700) #5421

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

Closed
wants to merge 1 commit into from
Closed

[3.6] bpo-20891: Py_Initialize() now creates the GIL (#4700) #5421

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jan 29, 2018

The GIL is no longer created "on demand" to fix a race condition when
PyGILState_Ensure() is called in a non-Python thread.

Reenable test_capi.test_bpo20891().

(cherry picked from commit 2914bb3)

https://bugs.python.org/issue20891

The GIL is no longer created "on demand" to fix a race condition when
PyGILState_Ensure() is called in a non-Python thread.

Reenable test_capi.test_bpo20891().

(cherry picked from commit 2914bb3)
@vstinner
Copy link
Member Author

@pitrou: Do you think that it's ok to make such change in the stable 3.6? IMHO it's a bugfix and so must be backported to 3.6.

@pitrou
Copy link
Member

pitrou commented Jan 29, 2018

@vstinner I don't think so. People can already call PyEval_InitThreads.

@vstinner
Copy link
Member Author

@vstinner I don't think so. People can already call PyEval_InitThreads.

Since only two users complained about https://bugs.python.org/issue20891 in 3 years, I agree that it's ok to not fix Python 2.7 and 3.6. The workaround is to call PyEval_InitThreads() before starting the first thread.

I wasn't excited to make such stable in stable 2.7 and 3.6 anyway :-)

@vstinner vstinner closed this Jan 29, 2018
@vstinner vstinner deleted the gil_created36 branch January 29, 2018 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants