
The art of multiprocessor programming
by Maurice Herlihy · first published 2008
64mentions
27recommended by
44HN commenters
2009–2026first – last mentioned
61% recommend34% neutral5% critical
Why HN recommends it
Rigorous yet readable treatment of concurrent programming: locks, then lock-free and wait-free data structures, with Java code and enough formal grounding to reason about correctness. Suits engineers and students.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.






…counters. For work queues you can solve it by giving each processor its own work queue and having it steal work from other processors when it finishes its own queue. A textbook by Herlihy and Shavit, The Art of Multiprocessor Programming, discusses this stuff in detail.
on “How I sped up my server by 6x (with 1 linux cmd)” ↗…For a super primer see https://en.wikipedia.org/wiki/Non-blocking_algorithm and if you are really interested, read about Transactional memory - http://dl.acm.org/citation.cfm?id=165164, and then "The Art of Multiprocessor Programming" (it is a text book) by Herlihy and Shavit.
on “Why Johnny Can’t Write Multithreaded Programs” ↗If you want to study the subject in more depth, I cannot recommand enough "The Art of Multiprocessor Programming" by Herlihy and Shavit. It has a nice theoretical part, followed by more practical applications. I also enjoyed "The Art of Concurrency" for a antagonist approach to a close domain. It may be more accessible.
on “Lockfree algorithms” ↗"Peopleware" http://www.amazon.com/Peopleware-Productive-Projects-Second-... , a lot of insights and ideas how to build great teams. Great to read for developers, team leads and managers. "The art of multiprocessor programming", excellent book on parallel programming theory with code explanations: http://www.amazon.com/gp/product/0123705916?ie=UTF8&tag=nirs...
on “Ask HN: What's the best programming book you've read recently?” ↗Once I've read an excellent book, The Art of Multiprocessor Programming [0]. All examples in the book are in Java. After reading it, when thinking about some of the solutions and algorithms presented, I quickly concluded that deploying them in C/C++ would be an order of magnitude…
on “Why is memory reclamation so important for lock-free algorithms?” ↗…synchronisation less painful. Same goes for atomic data structures. - Entity Systems[1] are actually surprisingly suited for multicore programming, IMHO I would suggest everybody to pick up the book The Art of Multiprocessor Programming[2] and get an introduction to the basic concepts. After that it depends on what you want to do, but if you're a C++ programmer, I would suggest the intel threading building blocks book[3]. [1] http://t-machine.org/index.php/2007/09/03/entity-systems-are...…
on “The Trouble With Multicore” ↗If you are into wait-free and lock-free data structures, you owe it to yourself to get Herlihy and Shavit's "Art of Multiprocessor Programming." http://www.amazon.com/Art-Multiprocessor-Programming-Maurice... Not only does it provide a well-debugged, well-written collection of wait-free data structures; it teaches you to think about concurrency…
on “A Fast Wait-Free Hash Table that Scales Linearly to Hundreds of Threads” ↗…algorithm in a bounded number of their own steps, irrespective of the activities of other threads. The definitions of wait/lock/obstruction freedom are well specified. I suggest the first half of _The Art of Multiprocessor Programming_ (the revised edition!) by Herlihy and Shavit for a deep dive.
on “Aeron: High-Performance Open Source Message Transport [video]” ↗Lock-freedom and wait-freedom are formal terms in concurrent algorithm theory. Best to check out Herlihy and Shavit, "The Art of Multiprocessor Programming," which I have unfortunately temporarily misplaced. Informally: "Lock-free" means that at each time step, at least one thread that is interacting with a shared object makes progress towards completing…
on “A fast multi-producer, multi-consumer lock-free concurrent queue for C++11” ↗The Art of Multiprocessor Programming by Shavit & Herlihy. Recommend topping it off with the lecture delivered at Microsoft Research (https://youtu.be/nrUszqrlvi8)
on “Ask HN: What's the best computer science book you've read recently?” ↗For people actually interested in parallel programming, particularly on Java, Herlihy's _The Art of Multiprocessor Programming_ is a fantastic introduction. On top of the grab-bag of techniques you'd expect, it boasts enough formal treatment to help folks learn to reason about correctness in their own programs.
on “Things you didn't know about multithreaded programming” ↗…in C++11), Intel's Thread Building Blocks, Java's built in Concurrency Utilities (java.util.concurrent package), Doug Lea's Fork Join Framework. The a great book on the subject is Maurice Herlihy's The Art of Multiprocessor Programming: http://www.amazon.com/The-Multiprocessor-Programming-Maurice... The book is in Java, but C++11 has the required primitives (cross platform compare and set for integral types, a defined memory model)…
on “Multithreaded data structures for parallel computing” ↗I cannot recommand enough "The Art of Multiprocessor Programming" by Herlihy and Shavit. Seconded. Its a great book, possibly my favorite book on the subject. I also like "Patterns for Parallel Programming" by Timothy Mattson, Beverly Sanders and Berna Massingill.
on “Lockfree algorithms” ↗For threads - check out "The art of multiprocessor programming" by Maurice Herlihy and Nir Shavit. I've found it to be really really good.
on “Ask HN: What do you want to learn in 2016?” ↗The Art of Multiprocessor Programming. by Maurice Herlihy and Nir Shavit is an excellent start.
on “Building a lock free continuous ring buffer in Rust” ↗