AWESOME book... but just a long, long read...
31 Mar 2008 @ amazon.com
It’s a great book that everyone should read. You’ll definitely wind up stopping yourself from some common mistakes that result in the ever-so-common "WTF?!?!!?" reaction when debugging for a couple hours and seeing things working just fine, but not working on and off in production. Yeah... then it dawns on you that there’s a synchronization issue.
This book helps keep those kind of issues in mind much, much better.
The only downside to the book is that it’s a complete bear to read. It’s just an exceedingly difficult book to work yourself through. I actually finished two other books while reading it. It’s just really heavy without any real breaks in there to keep it entertaining.
Again... great book, but in a next revision I hope the authors take some time to just make it a bit of a lighter read.
A Must Have...
25 Mar 2008 @ amazon.com
Another "A-List" Java book that needs to be in every Java reference library. "Java Concurrency in Practice" provides clear and concise coverage of a nontrivial subject.
Review for Java Concurrency in Practice
23 Mar 2008 @ amazon.com
In terms of the concurrency pragramming, this book is explaining more comprehensive concept and programming model of the thread programming. Also, it is good for upgrading to Java JDK 1.5 programming skills.
To sum, the author introduces the deeper and well understandable thread theory for Intermediate and advanced java programmers.
Very Practical
13 Feb 2008 @ amazon.com
For me, the most helpful feature of this book are the advices about what not to do -- Best practices on Java concurrency. The authors addressed all the problems I’ve had with Java concurrency. For those are not using Java 5 yet, it is interesting to remind that the examples are implemented in Java 5.
The last book that will ever be written on Java concurrency
20 Jan 2008 @ amazon.com
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.
Remarkable book
09 Jan 2008 @ amazon.com
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.
Simple clear advice on concurrency
30 Nov 2007 @ amazon.com
Don’t think I can add much to the review of this title, it is simply one of the
best and clearest books on concurrency usage in Java applications.
Dissection on Java Concurrency
22 Oct 2007 @ amazon.com
This is a book about Java concurrency design, not merely how to use Java thread through a set of APIs.
Authors go through fairly deep on what the challenges are faced by Java developers on designing robust concurrent applications, what should be considered to balance design forces between liveness and safety, how to utilize parallelism to achieve better scalabilities, what pitfalls should be avoided, how to test concurrent applications. A lot of practical examples are given under the context.
Most of "new" components in java.util.concurrent package are explored and analyzed, for what the thoughts are behind, why the design came the way it is and what balance it achieves. These components can be used as a basic building block for composing more sophisticated solutions to meet your application concurrency requirements.
Though the theories behind concurrency are not trivial, the book presents them in a very clear, concise and easy understanding way. It is a truly remarkable book for Java developers in trenches.
now printed on POOR QUALITY PAPER
18 Oct 2007 @ amazon.com
I’m sure the content is still superb. But the quality of the paper is pretty poor. The latest release of this paperback, 5th printing, July 2007, is printed on thin see-through recycled paper. I’m for preserving the environment, but I’m against paying full price for what seems like shoddy merchandise.
I tend not to buy international editions, precisely because the paper is so cheap that you can see right through it, making reading difficult. Sadly, this domestic edition suffers the same fate, albeit not as badly as some Low Priced Editions; it’s merely annoying. Truth be told, other domestic full priced editions also have translucent paper; but I still don’t like it, and the flimsy through-view paper in this book stands out.
Excellent explanation of a complex subject.
17 Oct 2007 @ amazon.com
The book explains in detail the issues of concurrency. Although a complex topic, the explanations are crystal clear. Well worth reading by anyone writing explicit multithreaded code, or implicit multithreaded code such as anything in a J2EE app server.
The best Java Concurrency book out there
12 Oct 2007 @ amazon.com
This is an excellent book on writing good thread-safe java code. It starts out with the concurrency basics, but gets into some more complex code design. Since multi-threaded applications and multi-processor boxes are becoming more and more common, this book is a must-read for every software developer.
Good Text, Lack of Details on Concurrent Package is a turn off
14 Sep 2007 @ amazon.com
Simply put this book can be viewed from a love it or hate it perspective, but personally when i bought Java Generics and Collections ( O Reilly ) i was impressed by the depth of their coverage, it gave me that inside edge and the internal knowledge of generics and collections ( how they work etc. ) This Book works well in giving what to do, what could have been done better and some portions on Concurrent package, but simply put I AM NOT SATISFIED WITH ITS COVERAGE ON CONCURRENT PACKAGE!. if you stack up generics against this one, i’d say generics is 200% better than this one.
So yea i was a bit disappointed with the book. But hey, nothing works better than the Java Language Spec Third edition =). ( at least it gives you everything exhaustively ).
Regards
Vyas, Anirudh
Avoid those unrepeatable bugs!
22 Aug 2007 @ amazon.com
Java Concurrency in Practice gives very complete coverage on the language’s concurrency classes introduced in Java 5 & 6. It shows you the shortcomings of previous attempts at concurrency in earlier versions of the JDK, with great code samples.
This book is pretty comprehensive and goes through the thinking/theory of why things are written the way they are, it is not just a paper version of the JavaDoc reference.
It is also very, very readable. I am by no means experienced in concurrency problems, but it was very easy to follow through the reasoning and examples. (my background is a CS degree and 1.5 years in the industry)
This book is a must read, especially for Java devs. Even if you are not a Java programmer, it could still be an enlightening read because it tells you how to structure your programs to deal with concurrency and how to deal with concurrent stateful apps, which unless you are using Erlang, is something you have to deal with.
beginner-oriented
25 Jul 2007 @ amazon.com
Good book, yet IMO it’s too "for beginners". Authors seem to explain things very slowly, perhaps it’s great for people with little programming experience, but I found the tempo a bit slow.
I think that Concurrent Programming in Java by Doug Lea is more appealing to experienced developer, unfortunately I don’t think there is a new edition out that covers Java 5. When/if new edition comes out, I’ll switch, but for now I’d stick with Java Concurrency in Practice.
Teaches clear thinking in thread programming
22 Jun 2007 @ amazon.com
Perfectly lucid style combined with a number of architectural patterns makes this book a treasure. Totally love it.
Very useful book on an increasingly important topic
05 Jun 2007 @ amazon.com
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.
Excellent
31 May 2007 @ amazon.com
Essential reading. Extremely well organized and written. Everything you need to know is covered in detail. If you have not read this book, it’s not likely that you will be able to write correct concurrent applications. There’s just way too much to know.
Good textual Book
23 May 2007 @ amazon.com
Goetz did a really nice nice job in putting together lots of issues on how to deal with concurrency in Java, not focusing only the util.concurrent/Java 5 API but how to make other aspects of the platform (such as frameworks, servlets and swing apps) to use them. The book is full of useful and detaild (although not boring) information and advice, using real examples.
Java Concurrency in Practice
18 Apr 2007 @ amazon.com
I’m not a stranger to the java.util.concurrent package, but must admit that I learned and awful lot by reading this (really well written) book. But be warned: The more you know, the more you know you don’t know...
nice book
21 Mar 2007 @ amazon.com
This is a nice book, with a great treatment of concurrency programming in Java. However, I would like to see a couple of "real" examples that uses the ideas discussed.
Excellent!
09 Mar 2007 @ amazon.com
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.
This is a must have
20 Feb 2007 @ amazon.com
I have only read first three chapters till now. But I can certainly say "This is a must have for all JAVA programmers.".
Exceptionally well written
12 Feb 2007 @ amazon.com
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.
excellent
20 Jan 2007 @ amazon.com
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!
A great explanation of a little-understood topic
18 Jan 2007 @ amazon.com
This is a very little-understood topic, especially among Filipino Java Developers. Reading it came at the right time, just when I’m starting to write some real concurrent apps.
This book helps even if you never plan to DIY concurrency, and are happy to rely on app server functionality. If you will never use concurrent or multithreaded Java - doubtful - JCIP is still useful because it helps you understand some Java concepts in a practical setting.
If you haven’t, reading Joshua Bloch’s Effective Java first is recommended.
Great for beginners on up
05 Jan 2007 @ amazon.com
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 :).
You need this book
30 Dec 2006 @ amazon.com
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.
Organized, thorough, and practical
28 Dec 2006 @ amazon.com
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, good luck, and I hope it doesn’t hurt too much.
Top Notch, advanced, readable and SCARY
08 Dec 2006 @ amazon.com
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.
Top-notch
30 Nov 2006 @ amazon.com
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.
Practical Java Concurrency for Java5/6
10 Nov 2006 @ amazon.com
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.
Excellent comprehensive software book
30 Oct 2006 @ amazon.com
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, that one is also an excellent "must read" material.
Must-read if you’re working with threaded Java applications...
07 Oct 2006 @ amazon.com
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.
At last! A readable, expert book on Java concurrency
07 Aug 2006 @ amazon.com
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.
Who’s afraid of concurrency now :-)
04 Aug 2006 @ amazon.com
This gem of a book is a comprehensive and authoritative coverage of one of the most mentally intimidating programming concepts - concurrency.
The JDK Concurrency API has done a great job at simplifying the concurrency issues. This book, i feel, is a great followup. I can already see those caffeinated developers smiling!
A big thumbs up! Great job!
Great summation for working engineers
31 Jul 2006 @ amazon.com
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.
must be at the shelf of every professional Java programmer
28 Jul 2006 @ amazon.com
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.
Fantastic Introduction.
26 Jul 2006 @ amazon.com
Worth its value. It is for advanced developers who have knowledge and understanding about Threads and memory management in OS.
goes beyond official Sun documentation
26 Jul 2006 @ amazon.com
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.
Excellent coverage of Java multi-threading
02 Jun 2006 @ amazon.com
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.
The definitive book on concurrency in Java
29 May 2006 @ amazon.com
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 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. Chapter 6 ,"Task Execution", covers identifying tasks that can be done in parallel and executing them within the task-execution framework. Chapter 7, "Cancellation and Shutdown", discusses the correct ways of terminating tasks and threads prematurely. How programs deal with termination is often one of the factors that separates truly robust concurrent applications from those that merely function under most circumstances. Chapter 8, "Applying Thread Pools", shows how a thread pool offers a solution to both the problem of thread life-cycle overhead and the problem of resource thrashing. By reusing threads for multiple tasks, the thread-creation overhead is spread over many tasks. Chapter 9, "GUI Applications", focuses on techniques for improving the responsiveness of single-threaded subsystems, 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. Chapter 10, "Avoiding Liveness Hazards", describes how to avoid liveness failures that can prevent programs from making forward progress. When a "liveness failure" occurs a thread waits forever, or at least until the next notification is somehow produced. Chapter 11, "Performance and Scalability", includes demonstrating the use of the "ThreadLocal" class to make it much easier to manage the process of associating a thread with its per-thread data. Chapter 12, Testing Concurrent Programs, covers techniques for testing concurrent code for both correctness and performance.
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. These code snippets 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.
The best book on Java in a long time
18 Apr 2006 @ amazon.com
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.
Clear approach to a complex topic
11 Apr 2006 @ amazon.com
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.