Explores starvation prevention in mutex implementation. Discusses weak vs strong semaphores, Morris’s solution using dual turnstiles and waiting rooms, and bounded waiting guarantees to prevent thread starvation in mutual exclusion.
Presents classic producer-consumer synchronization using event buffers. Details constraints on buffer access exclusivity and consumer blocking on empty buffers, with solutions using items and spaces semaphores for finite buffer handling.
Covers reader-writer problem enabling multiple concurrent readers while enforcing exclusive writer access. Uses lightswitch pattern where first reader locks resource and last reader unlocks, preventing deadlock while allowing categorical mutual exclusion.
Addresses reusable barriers for iterative thread synchronization. Introduces two-phase barrier using dual turnstiles to prevent threads from lapping each other, maintaining state reset for repeated synchronization cycles in loop-based thread cooperation.
Details barrier implementation challenges and deadlock avoidance. Discusses turnstile pattern for sequential thread passage and demonstrates deadlock scenarios when barriers are placed inside mutexes, requiring careful synchronization design.