GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-111964: Add _PyRWMutex a "readers-writer" lock by colesbury · Pull Request #112859 · python/cpython

Conversation

@colesbury

@colesbury colesbury commented Dec 7, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This adds _PyRWMutex, a "readers-writer" lock, which wil be used to
serialize global stop-the-world pauses with per-interpreter pauses.

  • Issue: Implement stop-the-world functionality (for --disable-gil builds) #111964

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
colesbury added 2 commits December 7, 2023 15:13
@colesbury
pythongh-111964: Add _PyRWMutex a "readers-writer" lock
fd61525
This adds `_PyRWMutex`, a "readers-writer" lock, which wil be used to
serialize global stop-the-world pauses with per-interpreter pauses.
@colesbury
Add comments and ASCII diagram based on review.
c6b9d62
Also, fix bug where `_PyRWMutex_Lock()` swapped the
return/continue conditions leading to an extra iteration of the loop.
@colesbury colesbury added topic-C-API 3.13 only security fixes topic-free-threading labels Dec 7, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Dec 7, 2023
Implement stop-the-world functionality (for --disable-gil builds) #111964
Closed
@colesbury colesbury added the skip news label Dec 7, 2023
@colesbury
colesbury marked this pull request as ready for review December 7, 2023 22:46
@colesbury
colesbury requested a review from ericsnowcurrently December 7, 2023 22:47
@bedevere-app bedevere-app Bot added the awaiting review label Dec 7, 2023
@colesbury colesbury mentioned this pull request Dec 7, 2023
gh-111964: Implement stop-the-world pauses #112471
Merged
ericsnowcurrently
ericsnowcurrently requested changes Dec 13, 2023
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

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.

Thanks for taking the time to split this out and address the other review comments I left on gh-112471. I've left a few here, including what might be a bug.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Include/internal/pycore_lock.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/lock.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/lock.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/lock.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/lock.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/lock.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Include/internal/pycore_lock.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting review labels Dec 13, 2023
@bedevere-app

bedevere-app Bot commented Dec 13, 2023

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ericsnowcurrently
ericsnowcurrently reviewed Dec 13, 2023
View reviewed changes
Comment thread Include/internal/pycore_lock.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

@colesbury
Update comments and add assertions.
e8419d7
Also describe _PyRWMutex using bit patterns instead of ASCII art box. This
matches how PyMutex is described.
ericsnowcurrently
ericsnowcurrently approved these changes Dec 14, 2023
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting changes labels Dec 14, 2023
@colesbury
Fix typo
1658506
@colesbury

colesbury commented Dec 14, 2023

Copy link
Copy Markdown
Contributor Author

(Fixed a typo in _PyRWMutex_RUnlock)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

colesbury added 2 commits December 15, 2023 11:41
@colesbury
Remove failing assertion
95f27c3
@colesbury
Add comment describing state with _Py_HAS_PARKED set
86fb625
@ericsnowcurrently

ericsnowcurrently commented Dec 15, 2023

Copy link
Copy Markdown
Member

@colesbury, I'm planning on merging this in the next hour or two. Let me know if you want me to wait.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@colesbury

colesbury commented Dec 15, 2023

Copy link
Copy Markdown
Contributor Author

Thanks - it's good to go now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently
ericsnowcurrently merged commit 5ae75e1 into python:main Dec 16, 2023
@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 16, 2023
@colesbury
colesbury deleted the rwmutex branch December 19, 2023 14:57
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@colesbury @aisk
pythongh-111964: Add _PyRWMutex a "readers-writer" lock (pythongh-112859
1101a68
)

This adds `_PyRWMutex`, a "readers-writer" lock, which wil be used to
serialize global stop-the-world pauses with per-interpreter pauses.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@colesbury @Glyphack
pythongh-111964: Add _PyRWMutex a "readers-writer" lock (pythongh-112859
09eb4f0
)

This adds `_PyRWMutex`, a "readers-writer" lock, which wil be used to
serialize global stop-the-world pauses with per-interpreter pauses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently ericsnowcurrently approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

3.13 only security fixes skip news topic-C-API topic-free-threading

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@colesbury @ericsnowcurrently
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.