Skip to content

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

Closed
vstinner wants to merge 1 commit into
python:3.6from
vstinner:gil_created36
Closed

[3.6] bpo-20891: Py_Initialize() now creates the GIL (#4700)#5421
vstinner wants to merge 1 commit into
python:3.6from
vstinner:gil_created36

Conversation

@vstinner

@vstinnervstinner commented Jan 29, 2018

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

@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
Copy Markdown
Member

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

@vstinner

Copy link
Copy Markdown
MemberAuthor

@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 deleted the gil_created36 branch January 29, 2018 13:06
Sign up for freeto 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

@vstinner@pitrou@the-knights-who-say-ni@bedevere-bot