hn.today

Book review: Is parallel programming hard, and, if so, what can you do about it?

ahelwer.ca6 points0 comments
Screenshot of Book review: Is parallel programming hard, and, if so, what can you do about it?

A seasoned TLA+ and distributed-systems practitioner describes reading Paul E. McKenney’s free online textbook Is Parallel Programming Hard, And, If So, What Can You Do About It? during a reflective break and finds it precisely targeted to learners wanting concrete, hardware-aware concurrency knowledge. Multiple PDF layouts are provided, but excessive internal links make e-reader navigation frustrating. Early chapters deliver a clear primer on modern CPU behavior and caches (the reviewer had to learn MESI separately), plus a striking demonstration that cores don’t perform literally simultaneous writes because cacheline ownership mediates stores. A tools chapter catalogs horror stories from compiler optimizations and CPU reordering, but leans toward Linux-kernel idioms and gives only brief treatment to C11/C++11 atomics and their formalizations.

The standout is chapter 5, “Counting,” which compares about ten counter implementations and shows why naive atomic increments perform poorly under cache coherence; per-thread arrays and attention to false sharing emerge as practical solutions, while more exotic constructs like the signal-theft limit counter remain intricate. Later chapters cover ownership, partitioning, deferred processing, validation (including techniques for hunting Heisenbugs), Promela/Spin formal verification, and lock-free algorithms and memory ordering in advanced chapters. Overall verdict: an excellent, motivating treatment that exposes many counterintuitive realities of parallel programming and sparks appetite to study lock-free design and high-performance garbage collection.

Read on ahelwer.ca0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.