Operating systems notes
Locks, Semaphores & Condition Variables
The concurrency toolbox, the primitives that turn "we need a critical section" into code that is actually correct. Every section is a drawn page beside a clear written explanation, about 19 minutes in all.
- Chapter 15 of 37
- About 19 minutes
- 9 sections
Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.

In this chapter
- Mutual exclusion, delivered
- Mutex locks: the everyday tool
- Spinlocks vs blocking locks
- Semaphores: counting permits
- Semaphore vs mutex: not the same tool
- Condition variables & monitors
- Deadlock, priority inversion & other lock hazards
- Higher-level abstractions
- Why engineers care
Next chapters
Read the whole chapter
Sign in and the chapter opens with every drawn page, and all 38 operating systems chapters beside it.
DSA comes with the all labs plan and every ChaiCode batch.