Skip to content
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

Python: GIL release via %threadallow #3238

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

andre-caldas
Copy link
Contributor

SWIG is capable of generating multi-threading code.

We allow locking the GIL when python code is called from C++ through some virtual method. However, we do not automatically allow the GIL to be released when C++ code is called from python, for that would happen in abut 9000 places and the performance penalty would not be negligible.

This is done with thread="1" and %feature("nothreadallow");.

However, for some selected methods we do release the GIL, allowing multi-threading. This is done with %threadsallow only for the methods Root::startRendering(), Root::renderOneFrame() and Root::_updateAllRenderTargets.

@andre-caldas
Copy link
Contributor Author

Linux build is failing because of this:
swig/swig#1996

@paroj paroj changed the title Allows multi-threading when rendering. Python: GIL release via %threadallow Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant