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.
J**B
You're not a professional Java developer until you've read this book twice
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.
Trustpilot
1 day ago
1 month ago