Truck Month Textbook Trade In Amazon Fashion Learn more nav_sap_plcc_ascpsc Sixx AM Fire TV with 4k Ultra HD Subscribe & Save Mother's Day Gifts Amazon Gift Card Offer ctstrph2 ctstrph2 ctstrph2  Amazon Echo  Echo Dot  Amazon Tap  Echo Dot  Amazon Tap  Amazon Echo Fire, Only $39.99 Kindle Paperwhite AutoRip in CDs & Vinyl Spring Arrivals in Outdoor Clothing SnS

Format: Paperback|Change
Price:$35.39+ Free shipping with Amazon Prime
Your rating(Clear)Rate this item


There was a problem filtering reviews right now. Please try again later.

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.
22 comments|96 people found this helpful. Was this review helpful to you?YesNoReport abuse
on August 7, 2006
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.
0Comment|39 people found this helpful. Was this review helpful to you?YesNoReport abuse
on June 2, 2006
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.
0Comment|34 people found this helpful. Was this review helpful to you?YesNoReport abuse
on April 10, 2006
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.
0Comment|16 people found this helpful. Was this review helpful to you?YesNoReport abuse
on December 8, 2006
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.
0Comment|11 people found this helpful. Was this review helpful to you?YesNoReport abuse
on April 17, 2006
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.
0Comment|16 people found this helpful. Was this review helpful to you?YesNoReport abuse
on July 28, 2006
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.
0Comment|8 people found this helpful. Was this review helpful to you?YesNoReport abuse
on December 27, 2006
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.
0Comment|6 people found this helpful. Was this review helpful to you?YesNoReport abuse
on July 11, 2015
I've been using Java in the professional setting for about 4 years now. There have been times where concurrent software implementations were a necessity to get the job done. It was during these projects where I realized that I was simply following a set of patterns that had been beaten into me by peers/blogs/how-to's over the years without really understanding the gritty details of why those patterns were needed, and what was actually happening.

This book IS the "why". This book is made out of 94% pure industry grade "grit".

Ever hear someone talk about thread visibility and not know what they were on about? Have you NOT heard of thread visibility? Ever wonder what exactly the "volatile" key word is and what it guarantees? Does the phrase "Java Memory Model" cause you anxiety at the mere mentioning of it?

This book will massage all those worries/misunderstandings/anti-patterns right out of your grey matter. The book is incredibly easy to read for anyone who has worked with Java seriously in the past. The book does a fantastic job of laying out in incredibly concise wording what it means to be thread safe, what it means to work atomically, what it means to have thread visibility, etc. etc. all the way into the deep bowels of the JVM's memory model, and how and why it's doing what it's doing. A must have book for any professional Java developer's library.
0Comment|3 people found this helpful. Was this review helpful to you?YesNoReport abuse
on June 26, 2011
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).
0Comment|15 people found this helpful. Was this review helpful to you?YesNoReport abuse