

"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 facilities explain not only how they work and how to use them, but also the motivation and design patterns behind them. However, developing, testing, and debugging multithreaded programs can still be very difficult; it is all too easy to create concurrent programs that appear to work, but fail when it matters most: in production, under heavy load. Java Concurrency in Practice arms readers with both the theoretical underpinnings and concrete techniques for building reliable, scalable, maintainable concurrent applications. Rather than simply offering an inventory of concurrency APIs and mechanisms, it provides design rules, patterns, and mental models that make it easier to build concurrent programs that are both correct and performant. This book covers: Basic concepts of concurrency and thread safety Techniques for building and composing thread-safe classes Using the concurrency building blocks in java.util.concurrent Performance optimization dos and don'ts Testing concurrent programs Advanced topics such as atomic variables, nonblocking algorithms, and the Java Memory Model
| Dimensions | 7 x 1.2 x 9.2 inches |
| Edition | 1st |
| Isbn 10 | 0321349601 |
| Isbn 13 | 978-0321349606 |
| Item Weight | 1.5 pounds |
| Language | English |
| Print Length | 432 pages |
| Publication Date | May 9, 2006 |
| Publisher | Addison-Wesley Professional |
User
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.
User
Ignore "JAVA" in the title - this teaches software concurrency
Every software engineer should truly understand the inner mechanics of concurrency in software, regardless of the language or system they're working in.When this book was written - Java was about as pure OOAD as you could get, which is why it is an excellent vehicle for teaching the core concepts around concurrency.I don't care whether you're working with async/await in C#, or goroutines in golang, you should start here if you want to learn and truly understand concurrency in software.
User
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.
User
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.
User
Highly Applicable for Fast Improvements
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.
User
Good book
Although a little bit outdated, it helps you understand the core of multithreading!
User
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.
User
Another Hit by Mr. Bloch
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.
User
Changed the way I reason about code
This is a must read for any developer working with the JVM. It starts lightly, showing concepts that you may already know, but as you dive deep into the book you will soon realize how little you know on concurrency. After reading the book you will gain all necessary tool to start reasoning on concurrent programs. You will look the topic from a totally different point of view. Mastering concurrency requires decades, and if you want to have the building blocks you should absolutely buy this book.
User
Five Stars
Verry good book
User
Fundamentos de programación con concurrencia y paralelismo
Es un libro que ya no está actualizado con el java moderno pero te ayuda a comprender como funciona la concurrencia y el paralelismo .Vale para aprender los fundamentos.
User
並列処理の教科書
並列処理や Thread について勉強しようと思ってこの一冊を購入した。読んでみたら、Bloch のEffective Java と並ぶ貴重な内容だった。書き方というえば、サーバーアプリなどの典型的な問題をあげて、駄目な解決法から、正解まで、微妙なコードも紹介しながら話を進めていくスタイル。コードの例も多くて、 幸いに実効できる長いプリントではなく、解決法に集中したリスティング。Concurrency は、 Generics のように綺麗に定義できる問題ではなく、CPU、Memory, Database といったリソースやアプリのジックと密接に絡まれる問題であることは、 この本で分かった。 そして、Concurrent プログラミングを身につけるためには並列処理の理解が一番重要。多量のリソースをどのように多量の処理に使用できる?問題点を上手く説明して、解決法も紹介してくれる大満足の一冊。Effective Java と一緒に参考として机の上に置くことにした。
User
Excelente livro, indico a compra.
Excelente livro, muito pratico e com detalhes avançados sobre tópicos do Java concorrência.
Trustpilot
3 days ago
1 month ago