Post

Systems goldmines: concurrency, memory, and the CPU

The under-known heavyweights of low-level systems: McKenney's perfbook, Drepper's memory paper, Agner Fog's manuals, Bakhvalov's free performance book, 1024cores, Preshing, and the linker essays.

Systems goldmines: concurrency, memory, and the CPU

TLPI is the known god-tier book for Linux. This list is its peers that somehow stayed obscure — each one written by the person who actually built or maintains the thing it explains.

Concurrency, from the kernel’s parallelism maintainer

  • Is Parallel Programming Hard, And, If So, What Can You Do About It? — Paul McKenney, free, continuously updated. The author maintains RCU in the Linux kernel; this is four decades of parallel-programming scar tissue in one book: counting (harder than you think), locking honestly appraised, memory ordering, RCU itself. If you read one thing on this list, read this.
  • The Little Book of Semaphores — Allen Downey, free. A problem book: classic synchronization puzzles (readers-writers, dining philosophers, the unlikely-sounding ones like “the sushi bar”) posed before their solutions. Working through it is the difference between recognizing concurrency patterns and deriving them.
  • 1024cores — Dmitry Vyukov (author of Go’s race detector and the MPSC queues everyone copies). Lock-free algorithms, memory models, and synchronization laid out by someone who ships them. His bounded MPMC queue writeup is the canonical one.
  • Preshing on Programming — the gentlest correct introduction to memory ordering that exists: acquire/release semantics, weak vs strong models, lock-free fundamentals, each post with diagrams that make the reorderings visible.
  • What every systems programmer should know about concurrency — Matt Kline. Sixteen pages; the ideal first read before the two books above.

Memory and the microarchitecture

  • What Every Programmer Should Know About Memory — Ulrich Drepper (glibc maintainer at the time). 114 pages on caches, TLBs, NUMA, and prefetching. From 2007 and still the reference — the constants changed, the model didn’t.
  • Agner Fog’s optimization manuals — five free manuals, maintained for over two decades: C++ optimization, assembly, microarchitecture of every x86 generation, and the instruction tables (latency/throughput for every instruction on every CPU). When people say “check Agner,” this is what they mean.
  • Performance Analysis and Tuning on Modern CPUs — Denis Bakhvalov. Free, open-source (PDF on GitHub); the second edition adds ARM and a chapter of case studies. The bridge between Gregg’s system-level view and Agner’s instruction-level one: top-down analysis, PMU counters, and what to actually do about the bottleneck you found. His easyperf blog is the ongoing serial.
  • Understanding Software Dynamics — Richard Sites (co-designer of the DEC Alpha). The book on finding the missing time in live systems — where did those 50ms go — built around tracing rather than sampling. Nothing else covers this territory.
  • Putting the “You” in CPU — Lexi Mattick. A free short book answering “what actually happens when you run a program” — syscalls, ELF, scheduling, forking — with the energy of someone who just found out and has to tell you. The best on-ramp to everything above.

The dark art nobody teaches: linking

  • Ian Lance Taylor’s 20-part linker essays — the author of gold explaining symbols, relocations, TLS, and shared libraries from first principles. Linking is where “it compiles” meets reality, and this is the only complete treatment written by a linker author.
  • Linkers and Loaders — John Levine’s book, free online. The book-length companion: object formats, dynamic linking, position-independent code.

The blogs that go with them

  • Chris Wellons (nullprogram) — C and systems craftsmanship; arena allocators, fuzzing, writing libraries with zero dependencies.
  • Paul Khuong — the deep end: SBCL internals, cache-efficient data structures, and numerical tricks measured properly.
  • John Regehr — undefined behavior, compiler testing, and why your C program is lying to you. The UB guide should be required reading.

Every entry here rewards the same habit: read with perf, a compiler explorer tab, or a test program open. These authors all wrote from experiments; the material only transfers the same way.

This post is licensed under CC BY 4.0 by the author.