Process Scheduling, Visualized
The CPU can run one thread at a time, so the kernel decides who gets it, for how long, and when to take it back. This video animates that decision: the runqueue, the tick, and the context switch that happens tens of thousands of times per second on a busy box.
Topics covered:
- Why preemptive scheduling exists and what a context switch actually costs
- The runqueue: how runnable tasks are stored and selected
- CFS: fair scheduling via virtual runtime, not fixed time slices
- Priorities, nice values, and how I/O-bound tasks get woken early
- Why
sleepandyieldbehave differently and when the kernel preempts you - Scheduling on multicore: per-CPU runqueues and load balancing
- What "responsive" means at the scheduler level and how it's measured
Related articles
Process vs Thread: What's Actually Different
Why fork and clone are the same syscall, why threads are 5-10x cheaper to create than processes, and what you give up in isolation when you share an address space.
How an Operating System Schedules a Thread
Between your code and the CPU sits a scheduler making decisions every millisecond: priorities, context switches, and the physics of 'the thread was runnable but the OS said no'.
What Really Happens During a System Call
Trap, ring transition, and the syscall table — the cost of asking the kernel for help and why it's never free.
More in Operating Systems
Virtual Memory in One Diagram
Page tables, TLB, demand paging, and copy-on-write — how your 16GB laptop 'has' 128GB of addressable memory.
WatchContainer Isolation in Linux
What Docker and Kubernetes containers actually are — namespaces, cgroups, and the syscalls that make isolated processes without a VM.
DetailsSignals and Interrupts
Hardware interrupts and Unix signals — the two asynchronous mechanisms that interrupt your program, and what the kernel does between the wire and your handler.
DetailsLocks and Synchronization Primitives
Mutexes, spinlocks, semaphores, and condition variables — how they map to hardware atomics and futexes, and when each one is the right tool.
DetailsMemory-Mapped Files
How mmap() maps a file into your address space — demand paging from disk, the page cache, and why mapped I/O beats read() and write().
DetailsFile Systems Explained
How a file system stores your data — inodes, directory entries, extents, and journaling — and what actually happens on read and write.
DetailsThread Pools Explained
How thread pools work under the hood — worker threads, work queues, and why reusing threads beats spawning them for every request.
DetailsSyscalls Under the Hood
What actually happens when your program calls read(), open(), or fork() — the trap, the kernel mode switch, and the return path.
DetailsVirtual Memory Explained
Address translation, page tables, and the TLB — the full path from a virtual address to the physical RAM cell, including why the translation is cached.
DetailsDepth, delivered weekly
One technical dispatch a week — articles and episode notes before they go public.
One technical dispatch per week. No noise.