-
Notifications
You must be signed in to change notification settings - Fork 10
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
Refactor async_rw_mutex
#1379
base: main
Are you sure you want to change the base?
Refactor async_rw_mutex
#1379
Conversation
This allows avoiding synchronization required when passing the value from one shared state to another.
Use the shared state already stored in the operation state in continuations.
…hared state Don't do it in the previous shared state, for simpler reasoning about ownership.
…on in async_rw_mutex for continuations
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
This is an attempt at slightly simplifying and optimizing the internals of
async_rw_mutex
. This avoids the needs for a lock to keep track of continuations and instead triggers continuations through operation states. The continuations are linked to each other through an intrusive linked list of operation states. These changes also avoid the need to have a weak shared pointer between shared states.Overall I'm hoping that the removal of extra reference counting and locks will slightly improve performance, but fundamentally the structure is still the same, requiring the same amount of dynamic allocations (cf. #1125; this PR does not address that) as before (in fact, one more allocation for the value stored by the mutex). So the impact may be minimal in terms of performance. However, I'm also making these changes to make the dependency triggering a bit more understandable.
I'm opening this for testing, but it's far from ready for merging. It still needs:
async_rw_mutex
, how are triggers continuations etc. Ideally with some diagrams as well.void
and non-void
cases.