ABSTRACT

This chapter considers the properties of the mutex, which is designed solely to provide mutual exclusion protection by avoiding conflict between threads and preventing unwanted interactions between threads. A mutex is a public resource that can be owned by, at most, one thread at any point in time. A mutex can provide exclusive access to one shared resource in the same manner that it can protect a critical section. A critical section is a code segment in which instructions must be executed in sequence without interruption. The Mutex Control Block is a structure used to maintain the state of a mutex during run-time. It contains a variety of information, including the mutex owner, the ownership count, the priority inheritance flag, the original priority of the owning thread, the original preemption-threshold of the owning thread, the suspension count, and a pointer to the suspension list.