Course · 6 lessons ~65 hr Advanced

Operating Systems — Processes, Memory & File Systems

Operating Systems — Processes, Memory & File Systems covers: OSTEP, Modern Operating Systems, The Design of the UNIX Operating System. Master the three pillars of operating systems: process management (creation, scheduling, concurrency), memory management (virtual memory, paging, segmentation), and file systems (storage, journaling, crash recovery). Understand what the OS does between your application and the hardware. Processes: Puma uses fork() to create worker processes. Each worker is a separate process with its own memory space, connected to the master by IPC. When you configure WEB_CONCURRENCY=4, Puma calls fork() four times. Now you know exactly what that means: four copies of the process, each with its own page table, each sharing the Ruby interpreter code pages (copy-on-write) but getting their own heap. Threads: Puma also uses threads within each worker. Ruby's GVL (Global VM Lock) means only one thread executes Ruby code at a time — but I/O operations (database queries, HTTP calls) release the GVL. Now you understand why: the GVL is a mutex around the Ruby interpreter, and I/O operations block in the kernel, releasing the mutex. Memory: Ruby's garbage collector manages memory on top of the OS's memory manager. Ruby calls malloc() to get memory from the OS, then manages Ruby objects within that memory. When Ruby's heap grows, it asks the OS for more pages. When the GC runs, it marks live objects and sweeps dead ones — but it does not always return memory to the OS (this is why Ruby processes often grow but rarely shrink). File Systems: Your database uses fsync() for durability. Your logs use buffered I/O for performance. Your uploads use temporary files. The OS's file system layer (VFS) handles all of this, and OSTEP explains exactly how.

reading · we frame, you read MIT or the canonical taught · we author, no canonical fits ↺ spirals back to earlier lessons
Course locked

Complete Computer Architecture — From Gates to CPU first.

This course unlocks once you've finished its prerequisite. Open prerequisite →

6 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.