After adding it to my reading backlog nearly two years ago, I’ve finally finished my first full read-through of “Java Concurrency in Practice”.
The content is great and I’d highly recommend it if you want to dive deep into concurrency.
Background
My previous experiences learning about concurrency were mainly through:
- Jakob Jenkov’s Java Concurrency and Multithreading Youtube Playlist
- Michael Pogrebinsky’s Java Multithreading, Concurrency & Performance Optimization Udemy Course (which included some exercises)
- Baeldung articles for specific topics and trivia questions
- An attempt at implementing a thread pool
What I liked about this book
- Drills deep into the Java concurrency APIs and practical advice on how to use them. By the end you’ll likely become reasonably familiar with questions like “why prefer atomic variables over volatile variables?” or “why prefer concurrent collections over synchronized collections?”.
- Covers concurrency across all levels from class design all the way down to the JVM and hardware details (e.g. compilation, the Java memory model, how atomic variables exploit “compare-and-swap” (CAS) machine instructions to outperform the alternative approach of using locks)
- Digs into the impact on wider concerns like testing, scalability and performance
- Occassionally illustrates concepts through real-world examples like GUI applications or logging services
How I read it
This is a dense technical book. I made it a goal to read up to ~50 pages in each sitting (which I didn’t always hit) to make the ~350 pages feel more manageable.
If you’re looking for a quicker crash course, I’d still highly recommend Jakob Jenkov’s free Youtube playlist. He covers most of the fundamental topics at a higher level, plus more recent developments like virtual threads (which were finalized in Java 21).
I expect it’d be challenging to recall everything unless you’re using it day-to-day, so I created my own notes while reading to use as a future refresher and reference.