The Runtime Theory
Operating SystemsPlanned

Operating Systems Intermediate

Video not available yet
30:00#intermediate#os#syscalls#concurrency#threads

Lesson Promise

By the end of this lesson, you will understand how system calls bridge user and kernel mode, how locks and semaphores prevent race conditions, and how the OS manages concurrent threads and virtual memory.

Narration Draft

Part 1 — System Calls (6:00) What a syscall is, the mode switch cost, common patterns (fork/exec, open/read/write), file descriptors, and zero-copy optimizations.

Part 2 — Process Management (5:00) How the kernel tracks processes via PCBs. The five process states and transitions. Context switching cost.

Part 3 — Concurrency (8:00) Race conditions, mutexes, semaphores, condition variables. The producer-consumer pattern. Deadlock conditions.

Part 4 — Virtual Memory (6:00) How the OS gives each process its own address space. Page tables, TLB, page faults. Demand paging.

Part 5 — Threads (5:00) How threads share memory, creation cost vs processes, the thread-pool pattern.

Visual Sequence

  1. User mode → kernel mode → user mode (syscall trap)
  2. Process state transition diagram
  3. Context switch: save registers A, restore registers B
  4. Race condition: two threads writing to shared variable
  5. Mutex lock/unlock: one thread in critical section, others blocked
  6. Page table: virtual address → physical address
  7. Page fault: TLB miss → kernel → load page from disk

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