Full description not available
C**E
The definitive book on concurrency in Java
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.
S**A
Nice Work
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.
S**H
A decent book on concurrent software engineering
I gave this five stars because as far as I know, this is the *best* book on engineering of highly- or moderately-concurrent software applications. It's the only one I'm aware of that addresses the topic in anything remotely approaching the way I'd like to see it. However, I'm underread in the field. I read the book from the perspective of somebody looking for existing books that cover the topic in the manner I'd like to see it covered. (I haven't found any yet, but this is the best so far.)I think there are lots of improvements that could be made. Obviously, there is some Java-specific stuff in here. Maybe the book suffers the flaw of being friendly to reentrant mutexes, but it has to deal with the Java world. I'd like it to cover 3 times the amount of material.The nicest and most useful thing I can say is: There is no part of this book that is destructively wrong, an abstract banality, or a waste of the reader's time. It's tightly focused, well-written, and in the worst case, it tells you stuff you already know.Highly recommended.
J**H
AWESOME book... but just a long, long read...
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.
Trustpilot
3 days ago
5 days ago
1 month ago