Calling C-API inside with_gil
#5162
Unanswered
taegyunkim
asked this question in
Questions
Replies: 1 comment
-
That's fine, any such api that release the gil will ensure to reacquire it before returning. See https://docs.python.org/3/c-api/init.html#releasing-the-gil-from-extension-code for more information. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What would happen if I call a CPython C API within
with_gil
and that releases the GIL?I believe it is possible to do that from a C native extension module, and that results in releasing the GIL, but when it returns back to the C native extension, the GIL will be held again.
Would the same happen with PyO3? or is this illegal or an error?
Beta Was this translation helpful? Give feedback.
All reactions