Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
AlexWaygood merged 5 commits intopython:mainfromcolesbury:critical_sections-ac
Nov 14, 2023

Conversation

@colesbury
Copy link
Contributor

@colesburycolesbury commentedNov 9, 2023
edited by bedevere-appbot
Loading

The@critical_section directive instructs Argument Clinic to generate calls toPy_BEGIN_CRITICAL_SECTION() andPy_END_CRITICAL_SECTION() around the bound function. In--disable-gil builds, these calls will lock and unlock theself 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.

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.
@colesburycolesbury marked this pull request as ready for reviewNovember 9, 2023 18:56
@erlend-aasland
Copy link
Contributor

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 and AlexWaygood reacted with thumbs up emoji

@colesbury
Copy link
ContributorAuthor

I added two tests toclinic.test.c and put up a PR for the devguide (python/devguide#1217)

erlend-aasland reacted with thumbs up emoji

@erlend-aasland
Copy link
Contributor

@AlexWaygood, are you fine with the clinic.py changes?

Copy link
Member

@AlexWaygoodAlexWaygood left a 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 :)

erlend-aasland reacted with hooray emojiitamaro reacted with heart emoji
@AlexWaygoodAlexWaygood merged commit324531d intopython:mainNov 14, 2023
@colesburycolesbury deleted the critical_sections-ac branchNovember 14, 2023 16:05
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
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.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
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.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@erlend-aaslanderlend-aaslanderlend-aasland approved these changes

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@colesbury@erlend-aasland@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp