Java Concurrency in Practice

Java Concurrency in Practice
by Brian Goetz, David Holmes, Doug Lea, Joseph Bowbeer, Joshua Bloch, Tim Peierls

Java Concurrency in Practice
List Price: $59.99
Our Price: $30.85
You Save: $29.14 (49%)
Availability: Usually ships in 1-2 business days
Buy Used: from $25.61 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Author: Brian Goetz, David Holmes, Doug Lea, Joseph Bowbeer, Joshua Bloch, Tim Peierls
Edition: Paperback
Audio: English (Unknown); English (Original Language); English (Published)
Published: 2006-05-19
ISBN: 0321349601
Number of pages: 384
Publisher: Addison-Wesley Professional
Accessories:

Book Reviews of Java Concurrency in Practice

Book Review: The definitive book on concurrency in Java
Summary: 5 Stars

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.

Summary of Java Concurrency in Practice

"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


Java Books

Book Subjects
Most talked about in Java Books
Who's Afraid of Java? ImageWho's Afraid of Java?
by Steve Heller
Academic Press; Published: 1997-07-30; Paperback; Book
Best price: $19.92
Price in other shops: $39.95
Decompiling Java (Java Masters) ImageDecompiling Java (Java Masters)
by Godfrey Nolan
McGraw-Hill Education; Published: 1998-11; Paperback; Book
A Comprehensive Introduction to Object-oriented Programming with Java ImageA Comprehensive Introduction to Object-oriented Programming with Java
by C. Thomas Wu
McGraw-Hill Higher Education; Published: 2007-03; Paperback; Book
Best price: $69.99
Android Application Development For Dummies ImageAndroid Application Development For Dummies
by Donn Felker
For Dummies; Published: 2010-12-07; Paperback; Book
Best price: $10.99
Price in other shops: $29.99
Java For Dummies ImageJava For Dummies
by Barry Burd
For Dummies; Published: 2011-08-11; Paperback; Book
Best price: $16.90
Price in other shops: $29.99
The Jini(TM) Specification (The Jini(TM) Technology Series) ImageThe Jini(TM) Specification (The Jini(TM) Technology Series)
by Ken Arnold, Robert W. Scheifler, Jim Waldo, Ann Wollrath, Robert Scheifler, Bryan O'Sullivan
Addison-Wesley Pub (Sd); Published: 1999-06; Paperback; Book
Best price: $7.38
Price in other shops: $39.95
Thinking in Java (2nd Edition) ImageThinking in Java (2nd Edition)
by Bruce Eckel
Pearson Education; Published: 2000-05-31; Paperback; Book
Best price: $3.32
Price in other shops: $44.99
Essential Jni: Java Native Interface (Essential Java) ImageEssential Jni: Java Native Interface (Essential Java)
by Robert Gordon, Rob Gordon
Prentice Hall PTR; Published: 1998-03; Paperback; Book
Best price: $32.00
Price in other shops: $34.95
Introduction to Java Programming, Comprehensive (8th Edition) ImageIntroduction to Java Programming, Comprehensive (8th Edition)
by Y. Daniel Liang
Prentice Hall; Published: 2010-01-13; Paperback; Book
Best price: $95.00
Price in other shops: $135.00
Instant Java Servlets (Book/CD-ROM package) ImageInstant Java Servlets (Book/ CD-ROM package)
by Phil Hanna
McGraw-Hill Companies; Published: 2000-05-22; Paperback; Book
Best price: $34.92
Price in other shops: $49.99
Similar Books and other products
Refactoring: Improving the Design of Existing Code ImageRefactoring: Improving the Design of Existing Code
by Martin Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts
Addison-Wesley Professional; Published: 1999-07-08; Hardcover; Book
Best price: $25.00
Price in other shops: $64.99
The Pragmatic Programmer: From Journeyman to Master ImageThe Pragmatic Programmer: From Journeyman to Master
by Andrew Hunt, David Thomas
Addison-Wesley Professional; Published: 1999-10-30; Paperback; Book
Best price: $35.60
Price in other shops: $49.99
Java? Puzzlers: Traps, Pitfalls, and Corner Cases ImageJava? Puzzlers: Traps, Pitfalls, and Corner Cases
by Joshua Bloch, Neal Gafter
Addison-Wesley Professional; Published: 2005-07-04; Paperback; Book
Best price: $31.96
Price in other shops: $44.99
Java Generics and Collections ImageJava Generics and Collections
by Maurice Naftalin Maurice, Philip Wadler
O'Reilly Media; Published: 2006-10-24; Paperback; Book
Best price: $24.68
Price in other shops: $34.99
Programming Concurrency on the JVM: Mastering Synchronization, STM, and Actors ImageProgramming Concurrency on the JVM: Mastering Synchronization, STM, and Actors
by Venkat Subramaniam
Pragmatic Bookshelf; Published: 2011-09-02; Paperback; Book
Best price: $19.91
Price in other shops: $35.00
Clean Code: A Handbook of Agile Software Craftsmanship ImageClean Code: A Handbook of Agile Software Craftsmanship
by Robert C. Martin
Prentice Hall; Published: 2008-08-11; Paperback; Book
Best price: $32.89
Price in other shops: $49.99
Design Patterns: Elements of Reusable Object-Oriented Software ImageDesign Patterns: Elements of Reusable Object-Oriented Software
by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
Addison-Wesley Professional; Published: 1994-11-10; Hardcover; Book
Best price: $35.45
Price in other shops: $59.99
Head First Design Patterns ImageHead First Design Patterns
by Elisabeth Freeman, Eric Freeman, Bert Bates, Kathy Sierra, Elisabeth Robson
O'Reilly Media; Published: 2004-11-01; Paperback; Book
Best price: $23.88
Price in other shops: $49.99
Java Performance ImageJava Performance
by Charlie Hunt, Binu John
Prentice Hall; Published: 2011-10-14; Paperback; Book
Best price: $40.97
Price in other shops: $59.99
Effective Java (2nd Edition) ImageEffective Java (2nd Edition)
by Joshua Bloch
Addison-Wesley; Published: 2008-05-28; Paperback; Book
Best price: $28.89
Price in other shops: $54.99