Chapter 6 · SimulationSynchronization Lab? ← Chapter 6 Mutex Semaphore Producer–Consumer Readers–Writers Philosophers CompareMode Procs 4 Capacity 2 Speed 1.5/s Step 0/0 ✓ Inside 0 ⏸ Blocked 0 ⚠ Deadlock CloseSynchronization LabEach process runs a small program made of wait/signal operations on semaphores. A round-robin scheduler lets the next unblocked process perform one operation per step, so you can watch who enters the critical section, who blocks in a semaphore’s FIFO queue, and who wakes whom. The panel on the right lists each process’s next operation and the latest events.UsagePick a scenario: Mutex (shared counter), Semaphore (limited permits), Producer–Consumer (bounded buffer), Readers–Writers, or Dining Philosophers.The controls on the second row change the option (locked or unlocked, which side is faster, ordered or naive fork picking), the number of processes (2–8) and the capacity (permits or buffer slots, 1–6).▶ plays; the step buttons move one operation back or forward, or jump to the start or end (up to 150 steps or until deadlock).Compare runs the current scenario’s options side by side for 120 steps.Operationswait(S)If S > 0, decrement it; otherwise block in S’s FIFO queue.signal(S)If someone is waiting, wake the first one (it receives the permit); otherwise increment S.SchedulerRound robin: the next unblocked process performs one operation.MutexA binary semaphore wrapping the read → modify → write steps.Race conditionNo synchronization: two stale reads make one update get lost.empty / fullEmpty / full buffer slots.rw_mutexThe first reader locks it, the last reader unlocks it; a writer must hold it alone.Ordered forksPicking the lower-numbered fork first breaks the circular wait.DeadlockAll processes blocked: nobody can signal.Legend ready ✓ in critical section ⏸ blocked last to actKeys←→ stepSpace playHomeEndEsc close