Uh oh!
There was an error while loading. Please reload this page.
gh-116322: Enable the GIL while loading C extension modules - #118560
Conversation
swtaarrs
commented
May 3, 2024
!buildbot nogil |
bedevere-bot
commented
May 3, 2024
🤖 New build scheduled with the buildbot fleet by @swtaarrs for commit 637c3e5 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
swtaarrs
commented
May 3, 2024
I have a local commit to update |
colesbury
left a comment
There was a problem hiding this comment.
This looks pretty good to me. Some comments below.
We should update sys._is_gil_enabled as part of this PR.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ericsnowcurrently
left a comment
There was a problem hiding this comment.
I have some questions.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ericsnowcurrently
left a comment
There was a problem hiding this comment.
I have one small comment. Otherwise LGTM.
(There is stuff to follow up on though.)
Uh oh!
There was an error while loading. Please reload this page.
…thon#118560) Add the ability to enable/disable the GIL at runtime, and use that in the C module loading code. We can't know before running a module init function if it supports free-threading, so the GIL is temporarily enabled before doing so. If the module declares support for running without the GIL, the GIL is later disabled. Otherwise, the GIL is permanently enabled, and will never be disabled again for the life of the current interpreter.
Building on gh-116882, this PR adds the ability to enable/disable the GIL at runtime, and uses that in the C module loading code.
We can't know before running a module init function if it supports free-threading, so the GIL is temporarily enabled before doing so. If the module declares support for running without the GIL, the GIL is later disabled. Otherwise, the GIL is permanently enabled, and will never be disabled again for the life of the current interpreter.