Reference and Selective Reading
You do not need to read the source books front-to-back for this module. Use the concept pages and practice pages first. Open these local chunks only when you need alternate exposition, more worked examples, or a deeper exercise lane.
Source Roles
| Source | Role | Why it is here |
|---|---|---|
| Operating Systems: Three Easy Pieces (OSTEP) | Primary teaching source | Best overall arc for threads, locks, condition variables, semaphores, classic problems, and deadlock |
| Operating System Concepts (Silberschatz) | Selective support | Strongest short reinforcements for the critical-section theorem, monitors as a formal construct, and deadlock handling methods |
| Unix Network Programming (Stevens) | Selective support | Useful for pthread API details, cross-process synchronization, and race-condition case studies in network contexts |
Read Only If Stuck
Race Conditions and the Critical Section
- OSTEP 26: Concurrency - An Introduction
- OSTEP 26.1: Example - Thread Creation
- OSTEP 26.2: Why It Gets Worse - Shared Data
- OSTEP 26.3: The Heart of the Problem - Uncontrolled Scheduling
- OSTEP: Key Concurrency Terms (aside)
- OSTEP 26.5: One More Problem - Waiting for Another
- OSTEP: Oh Oh, A Race (appendix walkthrough)
- OSC Chapter 4: Threads and Concurrency
- OSC 6.2: The Critical-Section Problem
- UNP: Race Conditions (Part 1)
- UNP: Race Conditions (Part 2)
Locks and Hardware Primitives
- OSTEP 27.1: Thread Creation
- OSTEP 27.2: Thread Completion
- OSTEP 27.3: Locks (pthread API)
- OSTEP: pthread API Guidelines
- OSTEP 28.1: Locks - The Basic Idea
- OSTEP 28.5: Controlling Interrupts
- OSTEP 28.6: Test-and-Set (Atomic Exchange)
- OSTEP 28.7: Building a Working Spin Lock
- OSTEP 28.10: Load-Linked / Store-Conditional
- OSTEP 28.11: Fetch-and-Add
- OSTEP 28.14: Using Queues - Sleeping Instead of Spinning
- OSTEP 28.16: Two-Phase Locks
- OSTEP 29.1: Concurrent Counters
- OSTEP 29.2: Concurrent Linked Lists
- OSTEP 29.4: Concurrent Hash Table
- UNP: Mutexes - Mutual Exclusion
Coordination Primitives
- OSTEP 27.4: Condition Variables (pthread API)
- OSTEP 30.1: Condition Variables - Definition and Routines
- OSTEP 30.2: Producer-Consumer Bounded Buffer (Part 1)
- OSTEP 30.2: Producer-Consumer Bounded Buffer (Part 2)
- OSTEP 30.3: Covering Conditions
- OSTEP 30.4: Summary
- OSTEP 31.1: Initializing a Semaphore
- OSTEP 31.3: Semaphores as Condition Variables
- OSTEP 31.4: Producer-Consumer with Semaphores
- OSC 6.6.1: Semaphore Usage
- OSC 6.7.1: Monitor Usage
- OSC 7.3.2: POSIX Semaphores
- OSC 7.4.1: Java Monitors
- OSC 7.4.4: Condition Variables
- UNP: Condition Variables
Classic Concurrency Problems
Deadlock and Modern Concurrency
- OSTEP 32: Common Concurrency Problems
- OSTEP 32.2: Non-Deadlock Bugs
- OSTEP 32.3: Deadlock Bugs
- OSTEP: Conditions for Deadlock
- OSTEP: No Preemption
- OSTEP: Mutual Exclusion
- OSTEP 32.4: Summary
- OSTEP 33.3: Using select (event-based concurrency)
- OSTEP 33.7: Another Problem - State Management
- OSTEP 33.9: Summary (event-based concurrency)
- OSTEP 34: Summary Dialogue on Concurrency
- OSC Chapter 8: Deadlocks
- OSC 8.3.1: Necessary Conditions
- OSC 8.4: Methods for Handling Deadlocks
Optional Deep Dive
- Preshing: An Introduction to Lock-Free Programming - the shortest high-quality introduction
- Preshing: Acquire and Release Semantics - memory-ordering intuition
- Paul McKenney: perfbook - book-length depth on parallel programming, RCU, and concurrency patterns
- Linux kernel: memory-barriers.txt - canonical kernel-level memory ordering reference
- Herb Sutter: Welcome to the Jungle - why concurrency is a first-class concern
Concept-to-Source Map
| Primary concept | Best source if stuck | Why this source |
|---|---|---|
| Threads, shared state, and non-atomic operations | OSTEP 26.2: Shared Data | The canonical counter example |
| Race conditions and the critical section | OSTEP 26.3: The Heart of the Problem | Scheduling as the root cause |
| Hardware foundation | OSTEP 28.6: Test-and-Set | Primitive constructively introduced |
| Spinlocks vs blocking mutexes | OSTEP 28.14: Sleeping Instead of Spinning | Best trade-off discussion |
| Test-and-set / CAS / lock implementations | OSTEP 28.7: Building a Working Spin Lock | End-to-end construction |
| Lock granularity | OSTEP 29.4: Concurrent Hash Table | Striping in practice |
| Condition variables | OSTEP 30.1: Definition and Routines | Clearest formal statement |
| Semaphores | OSTEP 31.4: Producer-Consumer with Semaphores | Counting semaphores in their natural setting |
| Monitors | OSC 6.7.1: Monitor Usage | Formal monitor construct |
| Producer-consumer | OSTEP 30.2: Producer-Consumer (Part 1) | Canonical reference implementation |
| Readers-writers | OSTEP 31.5: Reader-Writer Locks | Reference implementation with starvation discussion |
| Dining philosophers | OSTEP 31.6: The Dining Philosophers | The classical walk-through |
| Deadlock (necessary conditions and strategies) | OSTEP: Conditions for Deadlock | Coffman conditions presented clearly |
| Lock-free data structures and memory ordering | Preshing: Acquire and Release Semantics | Shortest accurate external treatment |
| Async/await and event loops | OSTEP 33.7: State Management | Why single-threaded is not bug-free |