
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Java Concurrency in Practice 1st Edition
"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
- ISBN-100321349601
- ISBN-13978-0321349606
- Edition1st
- Publication dateMay 9, 2006
- LanguageEnglish
- Dimensions7 x 1.2 x 9.2 inches
- Print length432 pages
Customers who viewed this item also viewed
- Effective JavaPaperbackFREE Shipping on orders over $49 shipped by AmazonGet it as soon as Thursday, May 22
- Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable SystemsPaperbackFREE Shipping on orders over $49 shipped by AmazonGet it as soon as Thursday, May 22
- Java Performance: In-Depth Advice for Tuning and Programming Java 8, 11, and BeyondPaperbackFREE Shipping on orders over $49 shipped by AmazonGet it as soon as Thursday, May 22Only 15 left in stock (more on the way).
- Modern Java in Action: Lambdas, streams, functional and reactive programmingRaoul-Gabriel UrmaPaperbackFREE Shipping on orders over $49 shipped by AmazonGet it as soon as Friday, May 2327% Claimed
- Design Patterns: Elements of Reusable Object-Oriented SoftwareHardcoverFREE Shipping by AmazonGet it as soon as Thursday, May 22
Editorial Reviews
From the Back Cover
"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
About the Author
Brian Goetz is a software consultant with twenty years industry experience, with over 75 articles on Java development. He is one of the primary members of the Java Community Process JSR 166 Expert Group (Concurrency Utilities), and has served on numerous other JCP Expert Groups.
Tim Peierls is the very model of a modern multiprocessor, with BoxPop.biz, recording arts, and goings on theatrical. He is one of the primary members of the Java Community Process JSR 166 Expert Group (Concurrency Utilities), and has served on numerous other JCP Expert Groups.
Joshua Bloch is a principal engineer at Google and a Jolt Award-winner. He was previously a distinguished engineer at Sun Microsystems and a senior systems designer at Transarc. Josh led the design and implementation of numerous Java platform features, including JDK 5.0 language enhancements and the award-winning Java Collections Framework. He holds a Ph.D. in computer science from Carnegie Mellon University.
Joseph Bowbeer is a software architect at Vizrea Corporation where he specializes in mobile application development for the Java ME platform, but his fascination with concurrent programming began in his days at Apollo Computer. He served on the JCP Expert Group for JSR-166 (Concurrency Utilities).
David Holmes is director of DLTeCH Pty Ltd, located in Brisbane, Australia. He specializes in synchronization and concurrency and was a member of the JSR-166 expert group that developed the new concurrency utilities. He is also a contributor to the update of the Real-Time Specification for Java, and has spent the past few years working on an implementation of that specification.
Doug Lea is one of the foremost experts on object-oriented technology and software reuse. He has been doing collaborative research with Sun Labs for more than five years. Lea is Professor of Computer Science at SUNY Oswego, Co-director of the Software Engineering Lab at the New York Center for Advanced Technology in Computer Applications, and Adjunct Professor of Electrical and Computer Engineering at Syracuse University. In addition, he co-authored the book, Object-Oriented System Development (Addison-Wesley, 1993). He received his B.A., M.A., and Ph.D. from the University of New Hampshire.
Product details
- Publisher : Addison-Wesley Professional; 1st edition (May 9, 2006)
- Language : English
- Paperback : 432 pages
- ISBN-10 : 0321349601
- ISBN-13 : 978-0321349606
- Item Weight : 1.5 pounds
- Dimensions : 7 x 1.2 x 9.2 inches
- Best Sellers Rank: #260,254 in Books (See Top 100 in Books)
- #30 in Java Programming
- #152 in Computer Programming Languages
- #612 in Computer Software (Books)
- Customer Reviews:
About the author

Brian Goetz is the Java Language Architect at Oracle Corporation, and was the specification lead for JSR-335 (Lambda Expressions for the Java Programming Language.) He is the author of the best-selling Java Concurrency in Practice, as well as over 75 articles on Java development, and has been fascinated by programming since Jimmy Carter was President.
Products related to this item
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Customers consider this the best book for understanding Java concurrency, praising its concise examples and right mix of theory and practice. Moreover, the book receives positive feedback for its material quality, value for money, and thread safety coverage, with one customer noting it covers both design principles. However, the synchronization aspect receives mixed reviews, with some customers noting it's not an introduction to concurrency.
AI-generated from the text of customer reviews
Customers praise this book as the best resource for understanding Java concurrency, describing it as a must-read for developers and an excellent guide to Java threading.
"...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..." Read more
"...and then moves onto structuring concurrent programs, testing concurrency programs and lastly advanced topics such as building custom synchronizers...." Read more
"...The book is incredibly easy to read for anyone who has worked with Java seriously in the past...." Read more
"Though the book is admittedly very good and valuable in content, the paper quality of the pages is absolutely horrible (as a previous reviewer noted)..." Read more
Customers appreciate the book's explanations, noting its use of concise examples and right mix of theory and practice. One customer mentions it clarifies obscure semantic points.
"...The code examples are either good examples, questionable examples, or bad code examples and are decorated with "Smiley Faces" that are either happy,..." Read more
"...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..." Read more
"...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..." Read more
"...It's amazing how these authors can clarify and explain extremely complex issues so that even old guys like myself can comprehend...." Read more
Customers find the material of the book to be great, with one customer noting that the concurrency package is pretty solid.
"...that foundation, the description of the Java 5's "util.concurrency" package is pretty solid; the book is not focused on the "how to use"..." Read more
"Even 12 years later, it is the best material i have read on multithreading with Java...." Read more
"...Distributed system, eventual consistency, highly availability over multiple nodes across the cluster...." Read more
"...I've not finished yet, but have good material to apply to my current application." Read more
Customers find the book to be a phenomenal value for money.
"Though the book is admittedly very good and valuable in content, the paper quality of the pages is absolutely horrible (as a previous reviewer noted)..." Read more
"Goetz's knowledge on Java concurrency is pretty phenomenal, and he does an even better job sharing this knowledge...." Read more
"...for everyday usage and ends with advanced topics.. There are many examples of good and bad concurrency snippets which makes things even clearer...." Read more
"...Minds were blown. It was hard but rewarding. Book was great support." Read more
Customers appreciate the book's design, with one mentioning its perfectly lucid style and another highlighting its practical design rules.
"...Its intention is to offer practical design rules to assist developers in the difficult process of creating safe, fast, and high-performance..." Read more
"...you will find there real explanations about platform,its design and features, buy it and gain fundamental knowledge , I bought it this year , reed..." Read more
"...He covers both design principals and description of existing concurrency libraries...." Read more
"...performant code that is truly thread-safe, emphasizing design principles with simple code examples...." Read more
Customers appreciate the book's coverage of thread safety, with multiple reviews highlighting its guidance on constructing thread-safe classes.
"...", (Chapters 2-5) are about the basic concepts of concurrency, thread safety, and composing thread-safe classes from those concurrent building..." Read more
"...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..." Read more
"...This book is filled with useful information about how to write safe concurrent Java...." Read more
"...this book up, I get a new level of insight into better, safer concurrent programming. It has both practice and theory...." Read more
Customers appreciate the book's comprehensive coverage.
"A very good overview of Java concurrency. It is brief but covers a lot. A must read for every JVM developer out there." Read more
"The book's coverage is good. However, is not a good learning book since the source codes are not ready to run. you..." Read more
"Comprehensive coverage on one of the most advanced topics in Java..." Read more
"Great coverage of this challenging part of Java..." Read more
Customers have mixed opinions about synchronization in the book, with several noting it's not an introduction to concurrency. One customer mentions it provides a good introduction to synchronization primitives, while another highlights the foundational role of AbstractQueuedSynchronizer.
"...locks, atomic variables, nonblocking algorithms, and developing custom synchronizers...." Read more
"...The preface to this book clearly states that this book is not an introduction to concurrency..." Read more
"...to Object.wait() and .notify(), and even into the foundational AbstractQueuedSynchronizer, which a lot of the higher-level APIs use under the..." Read more
"...As the book states, it is not an introduction to concurrency so you should at least have a good understanding of Java threading basics before..." Read more
Top reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on May 29, 2006Concurrency, 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.
- Reviewed in the United States on August 3, 2011This 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.
- Reviewed in the United States on July 12, 2015I'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.
Top reviews from other countries
- ReddoneReviewed in Italy on October 1, 2020
5.0 out of 5 stars 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.
- Costi FilipoiuReviewed in Canada on August 17, 2015
5.0 out of 5 stars Five Stars
Verry good book
- Ragnar LothbrokReviewed in India on October 20, 2024
5.0 out of 5 stars Classic book
Useful concepts of java concurrency. Book paper quality was also good.
- DouglasReviewed in Brazil on April 14, 2023
5.0 out of 5 stars great
great book
-
ピンReviewed in Japan on August 10, 2010
5.0 out of 5 stars 並列処理の教科書
並列処理や Thread について勉強しようと思ってこの一冊を購入した。
読んでみたら、Bloch のEffective Java と並ぶ貴重な内容だった。
書き方というえば、
サーバーアプリなどの典型的な問題をあげて、
駄目な解決法から、正解まで、微妙なコードも紹介しながら話を進めていくスタイル。
コードの例も多くて、 幸いに実効できる長いプリントではなく、解決法に集中したリスティング。
Concurrency は、 Generics のように綺麗に定義できる問題ではなく、CPU、Memory, Database といったリソースやアプリのジックと密接に絡まれる問題であることは、 この本で分かった。 そして、Concurrent プログラミングを身につけるためには並列処理の理解が一番重要。
多量のリソースをどのように多量の処理に使用できる?
問題点を上手く説明して、解決法も紹介してくれる大満足の一冊。
Effective Java と一緒に参考として机の上に置くことにした。