Skip to content

bpo-20891: Py_Initialize() now creates the GIL - #4700

Merged
vstinner merged 4 commits into
python:masterfrom
vstinner:gil_created
Jan 29, 2018
Merged

vstinner merged 4 commits into
python:masterfrom
vstinner:gil_created

Conversation

@vstinner

@vstinner vstinner commented Dec 4, 2017 •

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

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/

Copy link
Copy Markdown
Member Author

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"

@pitrou

pitrou commented Dec 4, 2017

Copy link
Copy Markdown
Member

Is there any documentation to update?

@vstinner

vstinner commented Dec 4, 2017

Copy link
Copy Markdown
Member Author

Is there any documentation to update?

Done, see my updated PR.

Comment thread Doc/c-api/init.rst Outdated

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@warsaw

warsaw commented Dec 15, 2017

Copy link
Copy Markdown
Member

This branch seems to fix the issue for me on macOS 10.12.6

@vstinner

Copy link
Copy Markdown
Member Author
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
vstinner merged commit 2914bb3 into python:master Jan 29, 2018
@bedevere-bot

Copy link
Copy Markdown

@vstinner: Please replace # with GH- in the commit message next time. Thanks!

@vstinner
vstinner deleted the gil_created branch January 29, 2018 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants