Skip to content

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

@harshit54

Description

@harshit54

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions