Frontend Labs
⋯

0.4 The little computer science you need

Four ideas, and you're equipped for everything that follows.

   1. A COMPUTER ONLY DOES ONE THING AT A TIME, PER CORE.
      Everything that looks "simultaneous" -- 200 browser tabs, a hundred
      server processes -- is actually the CPU switching between them very
      fast (Chapter 8). "Concurrency" (juggling many things) is not the
      same as "parallelism" (doing many things at the exact same instant,
      which needs multiple cores).

   2. MEMORY IS A LADDER, AND EACH RUNG IS ORDERS OF MAGNITUDE SLOWER.
      CPU register (~1 cycle) -> CPU cache (~few cycles) -> RAM (~100s of
      cycles) -> SSD (~10,000s of cycles) -> spinning disk / network
      (~millions of cycles). Most of performance engineering is "keep the
      hot data as high on this ladder as possible" (Chapter 12).

   3. EVERYTHING IS A NUMBER, AND NUMBERS ARE CHEAP TO PASS AROUND.
      A process is identified by a number (a PID). A file, once opened, is
      identified by a number (a file descriptor). This is why Unix tools
      compose so well -- they're all just passing small numbers and
      streams of bytes around.

   4. THE KERNEL IS THE ONLY THING TOUCHING THE HARDWARE.
      Your program never talks to the disk, the network card, or memory
      management hardware directly. It ASKS the kernel to do it (a system
      call, Chapter 2) and waits. Every "how does X work" question in this
      guide eventually resolves to "the kernel did it, here's how."

Generated from real-life-os-guide.md · 8 Oct 2026 16:36