Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-111903: Add@critical_section directive to Argument Clinic.#111904
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The `@critical_section` directive instructs Argument Clinic to generate callsto `Py_BEGIN_CRITICAL_SECTION()` and `Py_END_CRITICAL_SECTION()` around thebound function. In `--disable-gil` builds, these calls will lock and unlockthe `self` object. They are no-ops in the default build.This is used in one place (`_io._Buffered.close`) as a demonstration.Subsequent PRs will use it more widely in the `_io.Buffered` bindings.
erlend-aasland commentedNov 10, 2023
Thanks! Can you please add tests? Also, we need to update the docs over at the devguide. Can you prepare a PR for that? |
colesbury commentedNov 10, 2023
I added two tests to |
erlend-aasland commentedNov 14, 2023
@AlexWaygood, are you fine with the clinic.py changes? |
AlexWaygood left a comment
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.
This LGTM, sorry for the slow response! I'm not sure Ifully understand what the@critical_sectiondoes, but that's more of a documentation question -- this PR looks fine. I'll try to find some time today or tomorrow to comment on the devguide PR you've put up :)
python#111904)The `@critical_section` directive instructs Argument Clinic to generate callsto `Py_BEGIN_CRITICAL_SECTION()` and `Py_END_CRITICAL_SECTION()` around thebound function. In `--disable-gil` builds, these calls will lock and unlockthe `self` object. They are no-ops in the default build.This is used in one place (`_io._Buffered.close`) as a demonstration.Subsequent PRs will use it more widely in the `_io.Buffered` bindings.
python#111904)The `@critical_section` directive instructs Argument Clinic to generate callsto `Py_BEGIN_CRITICAL_SECTION()` and `Py_END_CRITICAL_SECTION()` around thebound function. In `--disable-gil` builds, these calls will lock and unlockthe `self` object. They are no-ops in the default build.This is used in one place (`_io._Buffered.close`) as a demonstration.Subsequent PRs will use it more widely in the `_io.Buffered` bindings.
Uh oh!
There was an error while loading.Please reload this page.
The
@critical_sectiondirective instructs Argument Clinic to generate calls toPy_BEGIN_CRITICAL_SECTION()andPy_END_CRITICAL_SECTION()around the bound function. In--disable-gilbuilds, these calls will lock and unlock theselfobject. They are no-ops in the default build.This is used in one place (
_io._Buffered.close) as a demonstration. Subsequent PRs will use it more widely in the_io.Bufferedbindings.Py_BEGIN_CRITICAL_SECTION()) #111903