Skip to content

gh-111964: Add _PyRWMutex a "readers-writer" lock #112859

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

Merged
merged 6 commits into from
Dec 16, 2023

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Dec 7, 2023

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

This adds `_PyRWMutex`, a "readers-writer" lock, which wil be used to
serialize global stop-the-world pauses with per-interpreter pauses.
Also, fix bug where `_PyRWMutex_Lock()` swapped the
return/continue conditions leading to an extra iteration of the loop.
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a 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.

@bedevere-app
Copy link

bedevere-app bot commented Dec 13, 2023

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.

Also describe _PyRWMutex using bit patterns instead of ASCII art box. This
matches how PyMutex is described.
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@colesbury
Copy link
Contributor Author

(Fixed a typo in _PyRWMutex_RUnlock)

@ericsnowcurrently
Copy link
Member

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

@colesbury
Copy link
Contributor Author

Thanks - it's good to go now.

@ericsnowcurrently ericsnowcurrently merged commit 5ae75e1 into python:main 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
)

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
)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants