Skip to content
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

loom: add abstraction for RwLock to remove poisoning aspect #6807

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

tglane
Copy link
Contributor

@tglane tglane commented Aug 30, 2024

With #6779 we removed unnecessary allocations from the timerwheel by wrapping it in an std::sync::RwLock. Since the Mutex used in this part of the project uses an abstraction in loom::sync::Mutex to get rid of the poisoning aspects of std::sync::Mutex the same should probably be done for the used read-write lock struct.

This commit introduces an abstraction to get rid of the poisoning aspects of std::sync::RwLock by introducing a wrapper to the loom::sync module similar to loom::sync::Mutex.

Refs: #6779

With tokio-rs#6779 we removed unnecessary allocations from the timerwheel by
wrapping it in an `std::sync::RwLock`. Since the `Mutex` used in this
part of the project uses an abstraction in `loom::sync::Mutex` to get
rid of the poisoning aspects of `std::sync::Mutex` the same should
probably be done for the used read-write lock struct.

This commit introduces an abstraction to get rid of the poisoning
aspects of `std::sync::RwLock` by introducing a wrapper to the
`loom::sync` module similar to `loom::sync::Mutex`.

Refs: tokio-rs#6779
@github-actions github-actions bot added R-loom-sync Run loom sync tests on this PR R-loom-time-driver Run loom time driver tests on this PR labels Aug 30, 2024
Copy link
Member

@mox692 mox692 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@mox692 mox692 added A-tokio Area: The main tokio crate M-time Module: tokio/time labels Sep 3, 2024
@mox692 mox692 merged commit bd4ccae into tokio-rs:master Sep 5, 2024
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-time Module: tokio/time R-loom-sync Run loom sync tests on this PR R-loom-time-driver Run loom time driver tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants