Home - Java

Product Details

Binding:

Kindle Edition

EAN:
Label:

Addison-Wesley Professional

Feature:
Publisher:

Addison-Wesley Professional

Studio:

Addison-Wesley Professional

Editorial Reviews

This is the eBook version of the printed book.

"I was fortunate indeed to have worked with a fantastic team on the design and implementation of the concurrency features added to the Java platform in Java 5.0 and Java 6. Now this same team provides the best explanation yet of these new features, and of concurrency in general. Concurrency is no longer a subject for advanced users only. Every Java developer should read this book."
--Martin Buchholz
JDK Concurrency Czar, Sun Microsystems

"For the past 30 years, computer performance has been driven by Moore's Law; from now on, it will be driven by Amdahl's Law. Writing code that effectively exploits multiple processors can be very challenging. Java Concurrency in Practice provides you with the concepts and techniques needed to write safe and scalable Java programs for today's--and tomorrow's--systems."
--Doron Rajwan
Research Scientist, Intel Corp

"This is the book you need if you're writing--or designing, or debugging, or maintaining, or contemplating--multithreaded Java programs. If you've ever had to synchronize a method and you weren't sure why, you owe it to yourself and your users to read this book, cover to cover."
--Ted Neward
Author of Effective Enterprise Java

"Brian addresses the fundamental issues and complexities of concurrency with uncommon clarity. This book is a must-read for anyone who uses threads and cares about performance."
--Kirk Pepperdine
CTO, JavaPerformanceTuning.com

"This book covers a very deep and subtle topic in a very clear and concise way, making it the perfect Java Concurrency reference manual. Each page is filled with the problems (and solutions!) that programmers struggle with every day. Effectively exploiting concurrency is becoming more and more important now that Moore's Law is delivering more cores but not faster cores, and this book will show you how to do it."
--Dr. Cliff Click
Senior Software Engineer, Azul Systems

"I have a strong interest in concurrency, and have probably written more thread deadlocks and made more synchronization mistakes than most programmers. Brian's book is the most readable on the topic of threading and concurrency in Java, and deals with this difficult subject with a wonderful hands-on approach. This is a book I am recommending to all my readers of The Java Specialists' Newsletter, because it is interesting, useful, and relevant to the problems facing Java developers today."
--Dr. Heinz Kabutz
The Java Specialists' Newsletter

"I've focused a career on simplifying simple problems, but this book ambitiously and effectively works to simplify a complex but critical subject: concurrency. Java Concurrency in Practice is revolutionary in its approach, smooth and easy in style, and timely in its delivery--it's destined to be a very important book."
--Bruce Tate
Author of Beyond Java

"Java Concurrency in Practice is an invaluable compilation of threading know-how for Java developers. I found reading this book intellectually exciting, in part because it is an excellent introduction to Java's concurrency API, but mostly because it captures in a thorough and accessible way expert knowledge on threading not easily found elsewhere."
--Bill Venners
Author of Inside the Java Virtual Machine

Threads are a fundamental part of the Java platform. As multicore processors become the norm, using concurrency effectively becomes essential for building high-performance applications. Java SE 5 and 6 are a huge step forward for the development of concurrent applications, with improvements to the Java Virtual Machine to support high-performance, highly scalable concurrent classes and a rich set of new concurrency building blocks. In Java Concurrency in Practice, the creators of these new faci...

Customer Reviews

Concurrency, in the form of threads, has been present in the Java language from its beginning, and this book is all about concurrency in the current and future versions of Java with an emphasis on writing practical code. This book does for concurrent programming in Java what Geary's series of books did for graphical Java - it moves concurrent Java programming out of the realm of applets containing bouncing balls and into that of providing real solutions for professional programmers.

This book is not meant to be an introduction to concurrency in Java. Its intention is to offer practical design rules to assist developers in the difficult process of creating safe, fast, and high-performance concurrent classes. While many of the general concepts in this book are applicable to versions of Java prior to Java 1.5, most of the code examples and all the statements about the Java Memory Model assume Java 1.5 or later. By "later" I mean that some of the code examples use library features added in the not-yet released Java 1.6. After the introduction, which consists of Chapter 1, the book is divided into four parts:

Part one, "Fundamentals", (Chapters 2-5) are about the basic concepts of concurrency, thread safety, and composing thread-safe classes from those concurrent building blocks provided by the Java language. Chapter 2, "Thread Safety", and 3, "Sharing Objects", include nearly all of the rules on avoiding concurrency hazards, constructing thread-safe classes, and verifying thread safety. Thus, these chapters emphasize theory and have less code than other chapters in the book. Chapter 4 , "Composing Objects", covers techniques for composing large thread-safe classes from smaller thread-safe classes. Chapter 5, "Building Blocks", covers thread-safe collections and synchronizers, which are the the concurrent building blocks provided by Java. To conclude the section, the authors work through the steps of building an efficient, scalable result cache that could be used in a web server. A summary of the most important rules presented in Part one occur at the end of the section.

Part two, "Structuring Concurrent Applications", describes how proper use of threading improves the throughput and responsiveness of concurrent applications. The topics covered in this section include identifying tasks that can be run in parallel and programming them as such, proper termination of tasks, using thread pools for greater efficiency in multi-threaded systems, and finally improving the responsiveness of single-threaded systems, GUI's being the most prominent example.

Part 3, "Liveness, Performance, and Testing" is concerned with ensuring that concurrent programs actually do what is expected of them and do so with acceptable performance. The authors describe how to avoid situations where a thread waits forever, also known as a "liveness failure". Also included in this section is an excellent explanation of the use of the "ThreadLocal" class and how it makes it much easier to manage the process of associating a thread with its per-thread data.

Part 4, "Advanced Topics", covers issues that will probably be interesting only to experienced developers. These topics include explicit locks, atomic variables, nonblocking algorithms, and developing custom synchronizers. Any of these techniques, explicit locks in particular, can cause chaos when done incorrectly. This book shows how to use these techniques safely and with confidence.

One of the things that makes this book so good are the many code examples. There are only snippets of entire programs included in the book itself in order to highlight the portions relevant to the concurrency issue being discussed. The code examples are either good examples, questionable examples, or bad code examples and are decorated with "Smiley Faces" that are either happy, concerned, or unhappy depending on the quality of the code. The full versions of the code examples, as well as supplementary examples and errata, are supposed to be available from the book's website. However, at the time I am writing this, they are not yet available.

Overall, I would say that this is the most complete and accessible resource on concurrency in Java I have seen in print. I highly recommend it.
Concurrency is hard and boring. Unfortunately, my favoured technique of ignoring it and hoping it will go away doesn't look like it's going to bear fruit. Fortunately, Java 5.0 introduced a new bunch of concurrency utilities, that work at a higher level of abstraction than marking blocks as synchronized and fields as volatile. Unfortunately, there haven't been that many books on the subject - even the good Java 5.0 books (e.g. Head First Java or Agile Java) make little mention of them - Thinking in Java being an honourable exception. Fortunately, JCIP is here, and it is authoritative stuff. And it's (mostly) very easy to understand. Plus, at 350 pages, it's not an enormous chore to slog through. It even covers changes to the upcoming Java 6.

Before tackling this book, you should have at least some idea of pre-Java 5.0 concurrency. You don't need to be a threading master, though, as the first part of the book covers basics like deadlock, atomicity and liveness. This was my favourite part of the book, as it comes with lots of small code snippets, both right and (horribly) wrong, and pithy design guidelines. It's rather like Effective Java in that respect - although the material on threading was probably the weakest part of that book, so this is a definite improvement.

The second part deals with thread pools, cancellation strategies, and GUIs. This is also excellent. Part three covers performance and testing. The last 75 pages are for advanced users and goes into a fair amount of low level detail (including a discussion of the Java Memory Model), which may be of interest to experts only.

I would be lying if I said that reading this book will demystify concurrency completely. Who wrote which bit of the book is unclear (although readers of Effective Java will probably spot parts of the text that seem rather Joshua Blochish), but while it's mostly very clear, some parts of the text are a little murkier than other. Perhaps this is to be expected given the subject matter. But for the most part it's surprisingly easy reading, and very practical to boot.

Let's face it, short of aliens landing and introducing a radically new way of computing, multicores are here for the medium term at least, so thread-dodging wimps such as myself will just have to get used to it. That being so, this book is going to be installed as one of the must-read books in the Java pantheon.
The book is by far the best one on Java concurrency. There is really nothing out there that has such comprehensive coverage of this topic. Doug Lee's book is a bit theoretical and somewhat dry, but would be a nice complement to this book if you want to think some more about concurrency. This book has a very strong practical vector. Coverage of Java 5 concurrency features is very thorough. The book is extremely well-written, relatively easy to read.

The book stands on par with such established Java book jems as Josh Bloch's "Effective Java", Eckel's "Thinking in Java" and Rod Johnson's J2EE books.

All in all, this is a definite must have for any Java specialist.


We've been reading a pre-release version of this book as part of a local study group and I'm very impressed with the treatment.

Concurrency is perhaps one of the hardest issues to understand well and it's equally difficult to explain all of the issues, but Goetz et. al. do a very nice job of explaining clearly the different ways a multi-threaded process can fail and then providing concrete design philosophies that will help address those problems.

In my experience, concurrency books often fall between providing too little detail ("just add synchronized to everything and all should be well") to providing too much ("details of how the Java Memory Model actually behaves on a multi-processor machine"). Java Concurrency in Practice seems to find a nice balance, e.g. thoroughly explaining why you need to worry about how values are "published" between threads but without swamping you with so much information about the details of how this is done by the VM that you're left gasping for air.

For me, this is a focus on the practical aspects of building multi-threaded applications in real world situations. In such cases, you need to fully understand the potential pitfalls and then you want to have a list of specific design methodologies which help avoid those failings. Java Concurrency in Practice does a nice job of providing both.


This is clearly one of the top notch Java books like Doug Lea's original "Concurrent Programming in Java". And like CPIJ it is scary. Can one ever get the concurrency aspects right enough? Are the books of other authors trustworthy (enough)? There is so little help from the language itself and the IDEs to get things concurrency correct. And the authors show in many examples, what all can go wrong and that our old "Von Neumann machine" intuition is plainly wrong and often highly misleading. With the inevitable concurrency, Java is in fact a language for advanced programmers. Things will in practice get worse due to the increasing ubiquity of multiprocessor computers even on the desktop.


The book is written by leading Java experts. It cites and uses in an unusually extensive ways some of the other classics in our Java world:
Arnold et al. "The Java Programming Language",
Lea "Concurrent Programming in Java",
Gosling et al. "Java Language Specification" and
Bloch "Effective Java".
It is helpful but not mandatory to know them. Better it is to have them handy to be able to quickly look things up. Most other referenced works are original articles.


"Java Concurrency in Practice" is written in a readable style - though the material is presented in an unusual dense way for an Addison and Wesley Java book. Expect an information density more like an O'Reilly one, but a lot lower than a Springer one. Anyhow the book gets easier to read as you and your understanding progresses.


The presented material relies on and explains the new concurrency features of Java 5 and even Java 6. But it is not a tutorial of the new concurrency classes. It is a high level introduction from the usage pattern point of view. It explains the new classes only as far as is necessary.


One of my favorite chapters is on testing concurrent programs. Yes, it is possible to make unit tests for concurrent classes. No, it does not look like it is much fun though. But, you get a good head start. Besides peer review you also find some testing help in static analyzers like "findbugs".


In summary I recommend this book as one of the core Java books. I still wish the world is - with respect to multithreading - easier and less intimidating.


Brian has a winner here. I was fortunate to obtain a preview copy from Brian Goetz and have devoured the book. This is the first book that I know of since Doug Lea's Concurrent Programming in Java, that addresses Java threading and concurrency with such vigor.

Each section has a solid example that will also stand up in the real world.

The book was put together very carefully, with great attention to detail, as is essential for a book about concurrency.

One of the best parts of the book was Brian leading me on all the time. He would show me a piece of code as a solution to a problem, and I would think of ways that it could cause problems. He then addressed those problems on his next page, but caused other problems. This carried on until the final solution, which was always elegant beyond anything I have written :-)

A solid 5 star rating for this book!

Definitely a good meaty book for Java Specialists.
As an experienced programmer (since 1973) with 9 year Java experience, I strongly recommend this beautiful small book for the professional Java programmer. This book has an excellent balance between academic formality and practicality. To gain confidence in exploiting the power of Java threads, do not loose the chance to read and keep as reference this book.

I take the chance to publicly thank all the authors for sharing their knowledge with an excellent, clear and concise style.
This book is a tour de force. The subject matter is intrinsically difficult and frighteningly susceptible to detail. I knew I had gaps in my knowledge when I started to read it, but the extent of my ignorance was chilling.

The book chooses a very thoughtful level of abstraction which gives the reader the opportunity to absorb the essential problems and patterns without straying too far from the inconvenient realities, at the same time teaching a kind of framework for analysis of multithreading issues. It is a very well organized book that will serve as a fine reference after providing the initial learning experience. The book's focus on the Java 5 concurrency library makes both the lessons and the library accessible and easy to exploit. The lessons are deep and varied and without exception practical.

Practising multithreaded programming in Java without reading this book is like doing aerials without a net. If you choose not to read it, good luck, and I hope it doesn't hurt too much.
The authors correctly point out that this topic, once the realm of advanced programming specialists, is now of concern to all programmers. Technology and the Java language both demand that software artisans understand concurrency and building thread-safe applications. The authors begin with some basics concerning concurrency and defining terms. This is essential since it seems an area where every software engineer seems to have their own definitions and assumptions. With the ground work complete, the authors continue on with various approaches to thread-safety and design considerations.

Included is a discussion of GUI development considerations, performance considerations, and testing strategies. Within an advanced topics section the authors cover explicit locks, custom synchronizers, and the Java memory model with respect to concurrency issues.

The writing style is clear, concise, and readable. Well worth the investment for the beginner or advanced student and sure to be referred to again and again in the future.
I have purchased or been given about a hundred tech books over the past two years and read nearly none of them -- except for this one. With the multi-core era upon us, the topic couldn't be more timely and I can't imagine this book being written any better. This is the book I read when I have a spare minute, and I always learn something I can't imagine how I lived without knowing beforehand. Bravo Brian et al.
I've read this book a few times and keep going back. Every time I pick this book up, I get a new level of insight into better, safer concurrent programming. It has both practice and theory. Anyone who says that do they multithreading/concurrent programming should have already read this book.
This is a really good book on concurrency. I had this book for a while but didn't bother to read from cover to cover until recently - while it was certainly neither an easy nor quick read, it was certainly well worth it. Before starting on this book, you will need at least some understanding of how concurrency works in Java at a basic level. The preface to this book clearly states that this book is not an introduction to concurrency (for which authors recommend the threading chapter in The Java Programming Language by Arnold) nor is it an encyclopedic reference on this subject (for which the authors recommend Concurrent Programming in Java by Doug Lea). The book starts off with fundamentals and then moves onto structuring concurrent programs, testing concurrency programs and lastly advanced topics such as building custom synchronizers. In general, the writing is clear and understandable for the most part although at some points in the book, it does become a bit of a tough read which I would expect in any concurrency text due to the depth and complexity of this topic. There are lots of examples in this book. I tested out pretty much all of them without any issues. In addition to illustrating how to write concurrent applications, this book also gives examples of how not to write them and explains why - which is great for remembering and every day usage. If you are interested in Java concurrency from a practical standpoint and not from theoretical side (which most practictioners would be), I think this is the best book in the market. I was never too excited about concurrency in Java but this book actually piqued my interest due to which I intend to check out the book by Doug Lea for more indepth treatment of this topic. Well deserved kudos to the authors. Two thumbs up.
I like the clear style of writing which balances simplicity of expression with the complexity of the material. After reading the first two chapters I am pleased by the ease with which the authors introduce this complex subject. They are interested not only in "correct" code but also performant code that is truly thread-safe, emphasizing design principles with simple code examples. The narrative parts are easy to understand by anyone familiar with the Java language.
If you program in Java you need to read this book. Even if you don't program in Java, 70% of this book holds true for non Java development too. Mr Goetz is clear, concise and will teach you how to program today's software applications correctly. Or at least defensively with an eye towards being performant.

I come from the embedded system realm where most of what Mr Goetz talks about, at least in theory, is second nature. However in Java, second nature for c/c++ doesn't mean you know how to do the same things in Java. Mr Goetz will get you there. From locking, to local copies, to shared spaces to Java specific executors - Mr Goetz covers it all. What I particularly enjoyed was his section on performance. Too often, when writing concurrent code, one tends to over protect. In Java Concurrency we are taught how to gain performance and still be safe. To say that the concept of scaling was well covered would be an understatement.

Quite frankly, this is one of the best programming books I've ever read. Up there with Code Complete. It will change the way you think about programming - for the better.
This is the best book on java. If you are planning on using java as a real language for development, you should read this book before you write your first interface or draw your first box on the whiteboard.

I buy this book for everyone who starts on my team. It is really that good.
Excellent and timeless work that everyone should read if you are writing Java applications because all apps are now running on multi-processor systems due to progress in Dual/Quad core chip technologies.
I've been doing Java development for close to thirteen years now, and I learned an enormous amount from this fantastic book. For example, I knew what the textbook definition of a volatile variable was, but I never knew why I would actually want to use one. Now I know when to use them and when they won't solve the problem.

Of course, JCP talks about the Java 5 concurrency library at great length. But this is no paraphrasing of the javadoc. (It was Doug Lea's original concurrency utility library that eventually got incorporated into Java, and we're all better off for it.) The authors start with illustrations of real issues in concurrent programming. Before they introduce the concurrency utilities, they explain a problem and illustrate potential solutions. (Usually involving at least one naive "solution" that has serious flaws.) Once they show us some avenues to explore, they introduce some neatly-packaged, well-tested utility class that either solves the problem or makes a solution possible. This removes the utility classes from the realm of "inscrutable magic" and presents them as "something difficult that you don't have to write."

The best part about JCP, though, is the combination of thoroughness and clarity with which it presents a very difficult subject. For example, I always understood about the need to avoid concurrent modification of mutable state. But, thanks to this book, I also see why you have to synchronize getters, not just setters. (Even though assignment to an integer is guaranteed to happen atomically, that isn't enough to guarantee that the change is visible to other threads. The only way to guarantee ordering is by crossing a synchronization barrier on the same lock.)

I've seen hundreds of web site crashes. Every single one of them eventually boils down to blocked threads somewhere. Java Concurrency in Practice has the theory, practice, and tools that you can apply to avoid deadlocks, live locks, corrupted state, and a host of other problems that lurk in the most innocuous-looking code.
Very simple -- if you need to write a concurrent Java application you must have this book.
The book teaches you more than just the theoretical aspects of concurrent programming such as exclusion mechanisms, liveness and safety issues, it shows the correct way to do it in Java.
A comprehensive tutorial of the concurrency package provided in j2se 5 and 6 is given, and I think it is a crucial aid for writing correct and maintainable concurrent code in Java.
The advanced topics in the book give you a better understanding of the inner workings of Java and even the inner workings of compilers and modern processors and this is done without going into redundant details.

The only comment I have about the book, is that I would expect at least a chapter or two about parallel and distributed programming and the available Java frameworks that support it.
I have been programming in Java for years, and yet I've generally ignored or otherwise avoided dealing with concurrency and synchronization at every opportunity because I found it so daunting. This book broke down that barrier for me and helped me to understand what I needed to do to write correct concurrent programs. In particular, the book provides concrete instructions that I was able to apply to projects that I am working on right now.

I would highly recommend this book to any Java programmer, as you are probably missing out on part of the capabilities of your language (and/or writing incorrect programs!) until you read this. It's probably not a bad lesson for developers of concurrent software in any language, but the concrete instructions regarding Java were really the most valuable part of the book to me.
This book is a must-read for anyone working in java with the shared-memory concurrency model. Ideas are very clearly exposed & the new java.util.concurrent package is explained perfectly.
If you work in java with threaded code, stop whatever you're doing and read this book, now!
I think the book is an excellent material not only on multi-threaded subject, but on software architecture in general. Things are said the way they are, without giving false expectations that multi-threading will solve all your performance issues. For instance, very realistic approach on how much concurrency will help, when all the program's tasks are serialized, waiting on each other. I agree with another reviewer that this is a nice complement to Doug's Lea "Concurrent Programming ...", but I disagree that Doug's material was "dry". If you're into multi-threaded (and quite frankly, even if you're not), that one is also an excellent "must read".
In Sun's official documentation for Java, there are aids on writing explicit multithreading programs. These are ok, as far as they go. But you might find that in an actual non-trivial, non-textbook case, strange things can happen. Deadlocking. Or perhaps low multicore usages. Or ...

This book goes way beyond the Sun documentation. It looks at many aspects of concurrency. Including how to make a thread safe class. Which is one of the basic things you need, given that Java is object oriented, and a typical program makes classes specific to its needs. Here, the guidelines are concise, requiring that you focus on defining the class's invariants and the variables that define the state of the class. The book does not seem to explicitly talk about the concept of a finite state machine. But that is essentially what you might want to consider for each of your classes that will have multithreaded access.

Also well worth attention is the chapter on multithread performance. Germane with the increasing availability of multicore processors. The chapter has a lucid explanation of the costs of having too many threads. You need to strive to minimise the maximum number of threads in your application. Context switching can be extremely costly in terms of time, and greatly reduce the overall efficiency.
Terrific coverage of advanced thread topics. You'll never look at your code the same way again. Great examples. Perfect balance between theory and practice.
It's common knowledge that you can easily get burned with Java programs that are multi-threaded. I would strongly recommend that if you are going down the multi-threaded path, you *need* to get this book... Java Concurrency In Practice by Brian Goetz. This bridges the gap between what the reference manuals say and how things work in the real world.

Contents:
Introduction
I. Fundamentals: Thread Safety; Sharing Objects; Composing Objects; Building Blocks
II. Structuring Concurrent Applications: Task Execution; Cancellation and Shutdown; Applying Thread Pools; GUI Applications
III. Liveness, Performance, and Testing: Avoiding Liveness Hazards; Performance and Scalability; Testing Concurrent Programs
IV. Advanced Topics: Explicit Locks; Building Custom Synchronizers; Atomic Variables and Nonblocking Synchronization; The Java Memory Model; Annotations for Concurrency
Bibliography; Index

This book picks up from the regular documentation on how specific synchronization and threading features work. Goetz does a relatively light introduction to the topic, and then starts into practical issues that you'll encounter in real programs and applications. For instance, a specific component, such as a collection, might be thread-safe. But what happens if that component is part of a compound function you've written? The compound function may well have "features" that you don't expect when running in the wild, since the threading issues now have to be considered at a level higher than the specific component. And being that you rarely have a clue as to how your program will mix with others, a bad design can lead to nasty intermittent threading bugs that are nearly impossible to consistently recreate. Goetz goes beyond the "write your code this way" material to explain how both code *and* design have to work in concert with each other to make sure a multi-threaded application behaves the way it should.

I was also impressed with the number of examples, both good and bad. By having a large number of "don't do this" samples, it's likely you'll see something that might be common practice in your coding style (but that will need to be changed). He also summarizes the material in gray call-outs within the flow of the text, so you can quickly grasp the one or two line concept that needs to be remembered and internalized in practice.

In a single word, this book can be summed up as "practical". Everything is focused on how things really work, and how to avoid common practices that will lead to major trouble. This is a great addition to the Java shelf of my library, and I recommend it with no hesitation.
This book completely demystifies the confusing world of Java concurrency. It's simple to read, in-depth, and provides many examples. Even with several years of Java experience under my belt, I always return to this book for a refresher. This should be required reading for any Java developer.
This book is awesome, I'm almost done reading it.
One thing though: to truly benefit from it I think you should have some experience in software design and coding multithreaded applications, and needless to say that you should feel comfortable with the Java standard library. for instance you will not understand the importance of client side locking or saturation and cancellation policies without proper experience in software design and multithreading.

The book covers almost everything you should know to write safe, high performance, efficient and scalable multithreaded applications, it drills down into most of the important classes in the Java concurrency library (java.util.concurrent), and explains how and when to use them. I love how the book is consistent with the previous Effective Java book (has many direct references to it) and how it puts emphasis on correctness and scalability. The book was written by my favorite Java gurus (Josh Bloch, Doug Lea), if you don't know these guys yet - you should. Bloch wrote most of the standard library, and Doug Lea's signature appears on most concurrency code in java.

Written for engineers, you can expect to also find benchmarking of different concurrent components, some formulas to measure and calculate optimal thread pool sizes, and many formal definitions and guidelines to live by.

Awesome. must have.
This is a superb book - coming from the master.
I started liking to read Brian Goetz and met him once at a No Fluff Just Stuff conference in Boston in 2010.
His articles online were very interesting and mind opening ones.
Same with this book. This book needs to be read slowly and digested and tried out before things make a lot of sense.
I was looking for a good concise book on Java Threading and Concurrency - after the overhaul was made in Java 5 onwards with the new Threading and Concurrency Libraries ( since reading disparate articles from the internet ) - made getting a conceptual clarity and full picture sometimes difficult.

This book solved my problem and filled the gap excellently.
I would recommend anyone working with Threads and needs to deal with Concurrency issues - to read this book.
With Multi core programming becoming the norm now - this book is a must read for any serious Java Developer

Thanks Brian - for taking your time in explaining the difficult concept lucidly in this book
After just the first couple of chapters I was able to fix several major bugs in my multithreaded applications. I have a number of Java certifications, but I would never have known about classes like AtomicInteger and AtomicReference without reading this book. It is definitely important to get the most performance possible out of your programs, especially in a service-oriented environment with lots of whining customers and little budget for hardware upgrades.

I was really impressed with the ExecutorService framework for fixed thread pools. I was asked to create a pooling mechanism simulating an application server that can be used for standalone testing. I originally created and managed the threads myself in an array, but this book gave me the information for making more use of the Java API in keeping the code clean. Using Callable instead of Runnable is great for getting results from your processes after they complete, and Future gives you a hook for cancellation/interruption.

There is a really interesting discussion on JVM shutdown. I have sometimes had processes that threw a Runtime exception but still held a database lock, causing deadlocks and contention later on. This recommends doing the final resource cleanup in the finally block of the "run" method. However, what if a "grid" monitoring process forces shutdown of my application? Would the Object's final() method insure that that my resource was cleaned up so that no lock is still held by the grid's JVM? The answer seems to be that the final method is less reliably called than the finally block, and that you should make your tasks "interruptable" by polling an unbounded queue or calling the thread's isInterrupted() method frequently. My questions aren't all answered on this, but I still have another 150 pages to go in the book.
Before purchasing this book I borrowed it from a friend. Unfortunately he needed it back before I could finish, but it didn't matter because I had already decided it should be part of my Java book collection. It fits right in with my other two favorite Java books, Effective Java and Java Puzzlers. This book does a great job of explaining concurrency in the Java language and the best practices. The book not only gives examples of what you should do, but also what not to do. The majority of the book describes Java concurrency practices at higher levels, but the last chapter also describes the Java Memory Model for those wanting to tie it all together. I would consider this book to be for intermediate and advanced Java programmers. As the book states, it is not an introduction to concurrency so you should at least have a good understanding of Java threading basics before jumping in.
The most comprehensive java threads book I have ever read. It gives an in depth knowledge of Multithreading issues and how to address them in many different ways, either by using the java.util.concurrent package or by the primitives wait/notify/notifyAll. As to the latters, it sheds a clear light on how to avoid issues like missing signals and othersl.
The existing positive reviews do a good job in justifying why you should read this book. It is a must-read for any intermediate Java developer.
The book is a must read for reasons other reviewers already have told. For me the main issue is the shocking discovery of the complexity involved in doing even basic multi-threading programming, in a world of tutorials and even books that try to convince you on the contrary.

Also, this book clarifies a lot of obscure semantic points in the threading classes (for example, the handling and "rethrowing" of interruptions) and open your eyes on subjects hidden in the specs that most developers will never read nor understand at all (like most thread visibility issues.)

With that foundation, the description of the Java 5's "util.concurrency" package is pretty solid; the book is not focused on the "how to use" (you can check the javadocs), but on the "why" of the several provided implementations, so you can deduce the "where" to apply them (the book's authors also participated in the design of those concurrency utilities.)

At risk of sounding repetitive, this book is a must read for any Java developer since most of them are currently involved directly or indirectly in MT programming (for example, inside a servlet environment.)
This book is really great. It briefly explains basics while not stick to them, continues with useful hi-api classes for everyday usage and ends with advanced topics.. There are many examples of good and bad concurrency snippets which makes things even clearer. This book is definitely not a concurrent API summarization - it on the other hand explains why, what and how to do things and why no to do them otherwise.. This book gives you very good awareness of concurrency in any language but it is purely Java oriented.

If you are afraid of concurrency as of some monster (as I was) then this book will open your eyes and gives you enough confidence to make correct concurrency programs.
It's a quality book for Java concurrency, well written and tremendously empowering. Every above-average Java developer should get a copy of this book. It is certainly not put down able in my experience.
This is definitely the best concurrency book for Java out there. It gives you pretty much all the concepts you ever need to know about concurrency in general. From basic concurrency principles to concurrency issues that would arise in almost all concurrent programs, and finally to some optimization techniques. It also provides some in-sights on some of the Java concurrent utility classes provided by the JDK package.

However, this book is not for Java beginners. You need to have an intermediate understanding of Java and some general programming/software engineering concepts. Also, if you are just starting with concurrent programming, this book might be slightly challenging at the beginning. But you should be able to pick it up fairly quickly.

And if you are already a concurrency expert or have quite some understandings about concurrency in general, this book will still solve a lot of the myths out there and may inspire you to further research on some of the topics.

Overall, this is a definite buy if you want to do concurrent programming.
This book is a must read for anyone who works in multithreaded environment. Even if you don't create threads yourself but use application server or any other environment where multiple threads execute at once, you cannot miss it. This book will tell you why and how synchronization happen - why what you think should work will not and how to read code for multithreaded application. If you never heard about Java Memory Model (JMM) you should not even touch multithreaded applications without reading this book.
This book is an essential resource for developer using the java.util.concurrency classes. It is written in a logical path that allows the reader to learn and understand not just the classes to use in writing concurrent applications but also why to write them using approach A versus B versus C.

The use of negative examples is really what makes this book great.
Although certain parts are a real brain tease (with certain pages taking 20-30 minutes of examination to fully understand) you come out with deep understanding that is lasting.

Bravo!
Having recently required to use Java in my work I needed a book to help explain the use of concurrency in Java. I have used C++ and Ada extensively in the defence environment for many years working on many multithreaded systems. For concurrency concepts, the book Concurrency in Ada by Burns and Wellings is still the bench mark, however while this is a Java book many of it concepts apply to any multithreaded language. This is a superb book.
As others have written, this is the best book out there on Java concurrency. I am a decent journeyman coder, not a guru, and this helped me wrap my head around what is involved with concurrency. Concurrency is in many ways orthogonal to the rest of Java programming, so it's good to get a clear and authoritative guide. I still avoid multi-threading whenever possible, but if I have to go there, I reach for this book.
This is the very best book available on concurrency. It covers all the Java 5.0 paradigms and goes from the explanation of volatile/final/mutable/immutable to advanced topics like re-entrant locks.
The best part about the book is Mr Yuk an icon to denote really bad thread unsafe code examples and comparison to different implementations that are correct -you will see from the first day onwards the mistakes that you have been making in your existing code. Very practical; Good explanation, lots of sample code.

Close your eyes look no further and get this book -you will not regret it.
An awesome book on concurrency that all Java programmers ought to read before embarking on anything more complicated than the primordial Hello World application.
After reading this book you will probably thank God that you haven't been using threads, but with that being said this book contains all the information you need to start writing code that walks the straight and narrow path.
This is "the" authoritative book on java concurrency. However, apart from some java specific items, the book is an excellent source on parallelism in general. Do not even try to implement parallelism without "reading and understanding" this book. Highly recommended !!!
This book explains a hard topic in crystal clarity. While doing that it provides invaluable expert insight into the topic. Also provides great explanation of java 5 concurrency utilities and how and where they should be used.
Concurrent programming is difficult and if you need to do it, you need this book.
A great way to get your feet wet with Java concurrency. It also grows well and will take you pretty far on the way to mastery (I'll let you know when I get there :).
I've read both this book and "Concurrency: State Models and Java Programs" by Jeff Magee & Jeff Kramer, and the difference couldn't be greater. While both books deal comprehensively with the theory and issues behind concurrency, Magee/Kramer's book is too entrenched in using the LTSA tool which then is modeled to match Java 1.1. Conversely, this book is extremely practical dealing with all the latest and greatest enhancements in the Java concurrency world, addressing topics like the Executor model, CyclicBarriers, Latches, BlockingQueue (just to name a few) yet still covers the underlying details of concurrency as well (if not better) than the Magee/Kramer book.

If you need to know about concurrency while developing for Java then look no further.

I am already fairly experienced at writing concurrent applications and bought this just to get a reference to the new concurrency features of Java 1.5. However, its so well organised and written that I have been reading it from start to finish just for the pleasure of it.
This is a great book for explaining what is involved with Java concurrency and provides a clear set of rules and guidelines for creating better code (or fixing your existing code). While I knew much of this material before, this book more concisely describes what a correct design needs than I have read anywhere else, and more clearly than I could have described to a colleague. This book should be required reading for any engineer writing multi-threaded Java code.
I purchased Java Concurrency in Practice based on the very high review its gotten. I have been a little disappointed. The book provides a great deal of do's and don'ts but at times (only sometimes) does not provide sufficient explanations. Essentially, the book makes final conclusions at the end of each sections but in some (certainly not all or most) cases, it does not provide sufficient examples, scenarios or details to backup the conclusions so it leaves the reader wondering how in the world did the author come up with the conclusion.

I will provide you with a concrete example:
On page 34, topmost paragraph, the authors state "and a thread other
than the publishing thread were to call assertSanity, it could throw AssertionError" then they elaborate but on the symptom: "The problem here is not the Holder class itself, but that the Holder is not properly published. However, Holder can be made immune toimproper publication by declaring the n field to be final, which would make Holder immutable;" rather than provide a concrete scenario of how the problem would occur. This leaves the reader trying to come up with a a sequence of events that will cause the AssertionError. In general, sometimes, after 30 mins or so, I would figure it out, but sometimes, as in this case, I can not.

On the other hand, the book does provide major practical benefits. For example, I had to refer to the book twice in one month, once to review the caching algorithm using FutureTask and one to trouble shoot a ConcurrentModificationException in JBoss from session replication. Hence, any book that I would need to refer to, however frequently or infrequently, deserves at least 3 stars. It would have been 4.5-5 stars if the explanations/justifications came with more detailed step-by-step replication procedure for all rather than for some. That could turn the book into a 500 page monster so I guess I understand why the authors didn't. Using the above example, I wished they had provided more scenarios of how/why ConcurrentModificationException is caused, in addition to the excellent example they provided (logger.info("...." + set) would generate the exception since set.toString() iterates thru the elements and other threads could be modifying the set).
I find this book one of the best to find out about java and its concurrency.
I use it as a reference book.
The first time you read, its hard to follow. But i thought reading it once made me aware of what all things java had to offer and then later use it as a reference whenever I had to look into a topic again.
 
Share your thoughts with other customers
Create your own review