
Mutex A mutex is a variable type that represents something like a "locked door". You can lock the door:
COS 318: Operating Systems Mutex Implementation (http://www.cs.princeton.edu/courses/cos318/)
Mutexes function as a traffic cop, they allow 1 thread in a critical section at a time, other threads are blocked.
mutual exclusion lock (mutex): Simplest general-purpose synchronizer Protects a critical section by first acquire() a lock, and then release() the lock acquire() and release() must be atomic, usually …
The key distinction lies in ownership: mutexes have a concept of ownership, whereas binary semaphores do not. This means that mutexes are better suited for implementing simple mutual …
Checking a Mutex Thus far, we’ve just locked or unlocked a mutex § What happens when we try to lock a mutex that is already locked by another thread? § We block! § In some cases, we want to …
Mutex A mutex is a variable type that represents something like a "locked door". You can lock the door: