-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
GH-97001: Release GIL in termios extension #99503
Conversation
IMHO this is a bug fix because you can currently block all Python threads using termios, hence it should be back ported to 3.10 and 3.11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm,
Super nit: Please unindent between Py_BEGIN_ALLOW_THREADS
and Py_END_ALLOW_THREADS
when considering the style of other code bases.
I'll change that before merging. I indent the code between these markers in my own code (including teaching clang-format about this) because this makes it clearer that there's a block of code with slightly different semantics. I prefer my own code style here, but consistency wins. |
This matches the rest of the code base.
Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, @ronaldoussoren, I could not cleanly backport this to |
GH-99679 is a backport of this pull request to the 3.11 branch. |
Without releasing the GIL calls to termios APIs might block the entire interpreter. (cherry picked from commit 959ba45) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
GH-99680 is a backport of this pull request to the 3.10 branch. |
Calls to termios APIs might block, therefore give up the GIL while performing these calls.