“Java concurrency in practice” book review
“Java concurrency in practice” is considered to be “the evergreen book”. Is it? Here is my take on it from the perspective of the year 2024.
Table of Contents
ToggleArcheology of concurrency in practice?
The book itself was published in 2006. That’s almost twenty years ago! In the introduction (and I got 13th print!) the authors claim that all the examples should work with Java 5, with some functionality covered only in Java 6. Well, I feel old now (and I have taken my meds in the morning), because I still remember those Java versions 😉 When starting a lecture, I was worried that I would be exposed all the time to crude synchronized-based solutions. Like the ones I had to deal with when preparing for SCJP over 10 years ago (got 100% score in the concurrency section though). However, that was not the case.
Obviously the scope of the book is limited – parts of Java that were introduced after version 6 are not covered (e.g. fork-join pools, not to mention recent virtual threads). However, I don’t see it as a disadvantage. This book (at least in my opinion), was not created as a handbook for every Java dev. It was more about something else.
Is this book really about concurrency?
I must admit that it is hard to be an unbiased reviewer here. Although I had not dabbled with concurrent code that much in my career, I have some years of experience under my belt. Therefore, concepts presented in the books aren’t that new to me. What is more – having some experience with lower-level programming, probably I am used to seeing passing of variables , memory model and execution flow differently than the regular Java developer (which does not mean it’s better – just different).
Having said that, in my opinion “Java Concurrency in Practice” tries to show the overall idea behind concurrency/parallelism. Used examples (of both the recommended and discouraged ways of doing things) are just them – examples to illustrate the underlying main principle. Specific Java solutions that are used, are just the necessary “implementation details” that must be used to present the main idea. If you are looking for a comprehensive, and practical explanation of Java’s concurrency capabilities – I would rather recommend the “Well-grounded Java developer” book. It is way more up-to-date, and concentrates on giving the developer the actual tools to use in everyday work. Plain and simple.
Summary
I know that this review does not look that much as a review. In my opinion, the book defends itself, despite its age. However, before starting a lecture, you need to understand that it’s not a handbook. If you are OK with that – then you won’t be disappointed. Chapters are dense with knowledge, but provided in the timely manner. I recommend reading it slowly, and taking the time to process.
The only technical problem I had was the ebook version. For reasons that are completely incomprehensible, all the listings in my copy weren’t actual listings! They were screenshots taken from the printed version. At least they look like it. It makes copying the code impossible and way less readable. What is more – listings are sometimes 3 pages away from its description/explanation. It really makes the whole experience harder and unpleasant.
I have also taken all the summary-quotes from the book, and compiled it into a single list. You can find in my GitHub knowledge repository.
Leave a Reply
You must be logged in to post a comment.