Concurrency utilities in JDK 5.0 – advanced
JDK 5.0 is a huge step forward in developing concurrent Java classes and applications, providing concurrency building blocks for both novices and experts. This session will explore the new low-level concurrency utilities included in JDK 5.0, and examine their features and scalability.
Prior to the release of JDK 5.0, the Java platform provided basic primitives for writing concurrent programs, but they were just that – primitive – and difficult to use properly. In addition to many new high-level concurrency utilities, such as semaphores, mutexes, barriers, thread pools, and thread-safe collections (described in the talk “Introduction to Concurrency Utilities in JDK 5.0”), JDK 5.0 also includes a number of JVM-level enhancements for concurrency, and a set of low-level concurrency utilities for developing highly scalable, nonblocking concurrent algorithms in Java.
While Java has included built-in support for locking and concurrency since JDK 1.0, the built-in locking mechanism (synchronization) has some significant deficiencies that make it unsuitable for certain applications. The java.util.concurrent.lock package, part of JDK 5.0, includes a highly flexible Lock class, which not only offers features not available with built-in locking, but also offers significantly better scalability.
Even with built-in support for locking, it has not been practical to develop nonblocking concurrent algorithms in Java prior to JDK 5.0. With JVM support for accessing hardware-provided concurrency instructions (such as CAS) and the atomic variable classes provided in java.util.concurrent.atomic, it is now possible to develop highly scalable, wait-free, lock-free classes in Java.
About Brian Goetz
Brian Goetz has been a professional software developer for 20 years. He is the author of over 75 articles on software development, and his book, Java Concurrency In Practice, was published in May 2006 by Addison-Wesley. He serves on the JCP Expert Groups for JSRs 166 (concurrency utilities), 107 (caching), and 305 (annotations for safety analysis). He is a frequent presenter at JavaOne, OOPSLA, JavaPolis, SDWest, and the No Fluff Just Stuff Software Symposium Tour. Brian is a Sr. Staff Engineer at Sun Microsystems.
More About Brian »