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

WIP: Add KeyedMutex #4065

Draft
wants to merge 4 commits into
base: series/3.x
Choose a base branch
from

Conversation

BalmungSan
Copy link
Contributor

Extention to the current Mutex class to support one look per key.

I still need to add tests. But first, I would like to receive feedback about the idea and implementation.

Some open questions I have:

  1. Should we use a MapRef instead of a Ref[Map]? Could that help reduce contention?
  2. Should we make the normal Mutex defer to this one, using Unit as the key? If not, should we share the LockQueueCell implementation rather than copy-paste it?

PS: Because this is a copy-paste of Mutex, IMHO it is easier to review each commit rather than the whole thing.

@BalmungSan BalmungSan marked this pull request as draft April 24, 2024 17:49
@SystemFw SystemFw assigned SystemFw and unassigned SystemFw Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants