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

Why do we need 3 mutexes and not 2? #1

Open
harshit54 opened this issue Dec 8, 2023 · 0 comments
Open

Why do we need 3 mutexes and not 2? #1

harshit54 opened this issue Dec 8, 2023 · 0 comments

Comments

@harshit54
Copy link

harshit54 commented Dec 8, 2023

So what's the point of the nextToAccessMutex?

Why can't we just do a lowPriorityMutex, highPriorityWaitGroup, dataAccessMutex with the locking patterns being:


  • High Priority Lock: highPriorityWaitGroup.Add(1), dataAccessMutex.Lock()
  • High Priority Unlock: highPriorityWaitGroup.Done(), dataAccessMutex.Unlock()

  • Low Priority Lock: highPriorityWaitGroup.Done(), dataAccessMutex.Lock()
  • Low Priority Unlock: dataAccessMutex.Unlock()
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

No branches or pull requests

1 participant