Check my review in javalobby http://java.dzone.com/reviews/java-concurrency-in-practice
Since I started working on java concurrency, I have been looking for a good book on concurrency that is clear, practical and easy to read. 'Java Concurrency in Practice' by Brain Goetz with Doug Lea etc, is by far the best one that I have come across. As opposed to Doug Lea's famous book 'Concurrent Programming in Java: Design Principles and Pattern' which I personally found hard to read and dry in style, this book is extremely well-written and relatively easy to read.
This book is very well organized and divided into four sections, starting from fundamentals like thread safety, atomicity, race conditions, locking, liveliness and goes on to concurrent collections like ConcurrentHaskMap, CopyOnWriteArrayList, BlcokingQueues, ConcurtrentLinkedQueue and other collections.
The second and third sections cover structuring concurrent applications, liveliness, performance and testing which includes Executor framework, boundedbuffers, thread life cycles overheads, context switches, different types of thread pools, thread factories, policies among some very useful techniques for reducing lock contention, lock stripping, avoiding dead locks etc.
I find chapter twelve ‘Testing Concurrent Programs’ particularly interesting and very useful considering how tricky and hard to test concurrent programs in real life.
And the last section covers advanced topics such Explicit locks and advantages and disadvantages of using intrinsic locks vs. explicit locks and read-write locks, performance considerations of using various types of locks, building custom synchronizers, atomic variables and non-blocking synchronization java memory model and annotations.
Recently while working on an application that deals with online advertising similar to Google Adwords and Adsense, I found myself referring to sections two and three very frequently for implementing boundedbuffers with BlockingQueues, ExecutorService and ThreadPools. The code examples presented are very practical and easy to understand.
In the end, this book is a must read for java developers, particularly if you are working with multi-threading and java.concurrenct package.
Monday, August 4, 2008
Java Concurrency In Practice - Book Review
Labels:
Barriers,
BlockingQueues,
Concurrency,
Executors,
Thread Pools
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment