Skip to content

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
@tglane tglane force-pushed the loom-rwlock-abstraction branch from a095833 to 20ca786 Compare August 30, 2024 20:19
@tglane tglane force-pushed the loom-rwlock-abstraction branch from 20ca786 to e899f77 Compare August 30, 2024 20:26
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
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