The Runtime Theory
Operating SystemsPlanned

Operating Systems Advanced: Scheduling, Deadlocks, and Concurrency

Video not available yet
28:00#advanced#os#scheduling#deadlock#concurrency

Lesson Promise

By the end of this lesson, you will understand how CPU schedulers choose which process runs next, the four conditions for deadlock and how to prevent them, and the concurrency primitives that protect shared data.

Narration Draft

Part 1 — CPU Scheduling (6:00) Why scheduling matters. FCFS, SJF, Round Robin. The convoy effect. Multilevel feedback queues. Linux's CFS (red-black tree, virtual runtime).

Part 2 — Deadlock Theory (6:00) The four Coffman conditions. Prevention strategies. Banker's algorithm for avoidance. Detection and recovery.

Part 3 — Concurrency Primitives (7:00) Mutexes, semaphores, condition variables. Race conditions and the lost-update problem. Lock-free alternatives.

Part 4 — Virtual Memory Deep Dive (5:00) Page tables, TLB, page faults. Demand paging. Swapping.

Part 5 — Real-World Patterns (4:00) Lock ordering to prevent deadlocks. Read-write locks. Thread pools.

Visual Sequence

  1. Scheduler decision diagram: ready queue → which process next?
  2. CFS red-black tree: insert by virtual runtime, pick leftmost
  3. Deadlock cycle: P1→R1→P2→R2→P1
  4. Banker's algorithm: safe state simulation
  5. Race condition: two threads incrementing a shared counter

Companion Material

Related articles

More in Operating Systems

New lessons by email

Get new articles and notes on the systems behind everyday software.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save