Concurrent Programming in Java: Design Principles and Pattern, 2nd Edition

by Doug Lea

Concurrency has always been a first-class citizen in Java. Threads, monitors (keyword "synchronized"), and guarded blocks ("wait"/"notify") have been part of the language since Java 1.0.

"Concurrent Programming in Java" is from 1999 and thus on the level of Java 1.2. Nevertheless, the described challenges of concurrent programming (security, liveness, performance) are still relevant today. So are the presented principles and design patterns, like synchronization and confinement, monitors, guarded waits and notifications, latches, worker threads, futures, fork/join, and many more.

Abstracting from this, the author introduces more complex, reusable utility classes for initiating and coordinating concurrent activities. Most of these classes are today – in an evolved form – part of the JDK. In the JavaDoc of these classes (e.g., Semaphore, ReentrantLock, Executor, or CountDownLatch – and in newer ones like CompletableFuture or StampedLock), you will find the signature of Doug Lea, the author of this book.

The book is not a light read. The writing style is academic and highly challenging. I had to read many paragraphs more than once and keep cross-referencing to other parts of the book to understand. With the examples, it is sometimes advisable to read the theory first, then the source code, and then the theory again. Every few pages, you have to take a break.

It took me several weeks to work through the entire work. But it is definitely worth the effort!

Once you have internalized the basics of this book, you will be able to write performant, thread-safe code and quickly recognize non-thread-safe code as well as the causes of race conditions. That will make you one of the most sought-after Java programmers.

🎧 Suitable as an audiobook? No, due to numerous diagrams and code examples.

Other Recommendations From This Books’s Genres

* Disclosure: We love sharing our favorite books with you! As an Amazon Associate, we earn a small commission from purchases you make through our links, which helps us continue creating content you enjoy.