FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-114271: Make `thread._rlock` thread-safe in free-threaded builds by mpage · Pull Request #115102 · python/cpython · GitHub

Repository navigation

gh-114271: Make thread._rlock thread-safe in free-threaded builds - #115102

Merged
colesbury merged 1 commit into
python:mainfrom
mpage:gh-114271-_thread-rlock
Feb 16, 2024
Merged

colesbury merged 1 commit into
python:mainfrom
mpage:gh-114271-_thread-rlock

Conversation

mpage commented Feb 6, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The ID of the owning thread (rlock_owner) may be accessed by multiple threads without holding the underlying lock; relaxed atomics are used in place of the previous loads/stores.

The number of times that the lock has been acquired (rlock_count) is only ever accessed by the thread that holds the lock; we do not need to use atomics to access it.

The embedded lock (rlock_lock) is already thread-safe.

The ID of the owning thread (`rlock_owner`)  may be accessed by
multiple threads without holding the underlying lock; relaxed
atomics are used in place of the previous loads/stores.

The number of times that the lock has been acquired (`rlock_count`)
is only ever accessed by the thread that holds the lock; we do not
need to use atomics to access it.

The embedded lock (`rlock_lock`) is already thread-safe.

mpage commented Feb 6, 2024

Copy link
Copy Markdown
Contributor Author

@colesbury - Can you add the "skip news" label?

colesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks! This LGTM

colesbury merged commit f366e21 into python:main Feb 16, 2024
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
…ilds (python#115102)

The ID of the owning thread (`rlock_owner`) may be accessed by
multiple threads without holding the underlying lock; relaxed
atomics are used in place of the previous loads/stores.

The number of times that the lock has been acquired (`rlock_count`)
is only ever accessed by the thread that holds the lock; we do not
need to use atomics to access it.
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…ilds (python#115102)

The ID of the owning thread (`rlock_owner`) may be accessed by
multiple threads without holding the underlying lock; relaxed
atomics are used in place of the previous loads/stores.

The number of times that the lock has been acquired (`rlock_count`)
is only ever accessed by the thread that holds the lock; we do not
need to use atomics to access it.
LukasWoodtli pushed a commit to LukasWoodtli/cpython that referenced this pull request Jan 22, 2025
…ilds (python#115102)

The ID of the owning thread (`rlock_owner`) may be accessed by
multiple threads without holding the underlying lock; relaxed
atomics are used in place of the previous loads/stores.

The number of times that the lock has been acquired (`rlock_count`)
is only ever accessed by the thread that holds the lock; we do not
need to use atomics to access it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL