This week's book giveaways are in the JBoss and Spring forums. We're giving away four copies each of JBoss AS 5 Development and Spring Dynamic Modules in Action and have the authors on-line! See this thread and this one for details.
<pre>Author/s : Brian Goetz, Tim Peierls, Joseph Bowbeer, David Holmes, Joshua Bloch, Doug Lea Publisher : Addison-Wesley Category :Advanced Java Review by : Lasse Koskela Rating : 9 horseshoes</pre> I've been doing most of my recent consulting in technology companies building systems that deal with concurrency, which is part of the reason why this book ended up on my desk -- I wanted to upgrade my know-how on the new concurrency features in Java 5 and a brand new book from recognized authors in the field sounded like a great source of information beyond the javadocs. And it is.
I'd almost call this the current bible on Java concurrency. At less than 400 pages it's relatively compact and still manages to properly cover a lot of ground. The text is easy to understand and avoids "difficult" words better than Doug Lea's "Concurrent Programming in Java", although it's been a couple of years since I read Lea's earlier book.
What I really like about the book is the thorough discussion on not just the API but also on the underlying theory. In other words, you're not just reading about the new synchronizer objects, thread factories or the executor architecture -- you're also getting the low-down on a lot of what's happening inside the JVM.
This, on the other hand, also makes the book somewhat less approachable as it might be if the authors would just give you the "tutorial". I did have hard time figuring out some sections on the first time around but I can't say it was because of the authors' writing. In any case, definitely not a course book for Java Programming 101.
It was a positive surprise to see the authors dedicating a chapter for testing multithreaded code. I would've wanted to read more on the topic, but the material in this one chapter is already a huge help in helping the reader to understand some important differences between unit testing the logic and the concurrent behavior of Java code.
I'm giving a big thumbs-up for "Java Concurrency in Practice". Besides the couple of pages in my copy having print quality problems (the copy we have at the office doesn't, so it's probably a one-off case), I don't have much negative things to say about this book. If you're looking for an advanced title on concurrency programming in Java, you won't go wrong with this one.
<pre>Category :Advanced Java Review by : Ulf Dittmer Rating : 8 horseshoes</pre> Java has had multi-threading capabilities from the beginning, but with the arrival of multi-core and multi-processor CPUs on desktops everywhere, and the broad range of new concurrency features in Java 5, there are no excuses any more not to take advantage of multithreading. Getting it right can be tricky, though, and that's where this book comes in.
It explains not just the features of the Java virtual machine and the class libraries that help implement concurrent applications, but also serves as an introduction to the problems arising in multi-threaded code in general. That can range from the small -how to share a class variable between threads - to the large - how to structure applications to take advantage of concurrency. More specialized chapters deal with threading in GUIs (important for Swing developers), how to maximize performance while retaining thread safety, and how to test concurrent code.
All concepts are explained with plenty of code examples that show what is and what isn't thread-safe. If several ways to solve a concurrency problem exist, their functional and performance differences are investigated, and -where possible- quantified. Engineering consists of tradeoffs everywhere, and this book makes clear how those between functionality, performance and thread safety can usefully be made.
Everyone not having had the benefit of CS 401 "Issues in Concurrency" will get a lot out of this book. And those who did will learn how to properly implement concurrent applications in Java.