Java's built-in support for writing multi-threaded applications, such as the Thread class and the synchronized keyword, are hard to use correctly because they are too low level. Java 5 added the Concurrency Utilities in the java.util.concurrent package and subpackages. The types in these packages have been designed to provide better alternatives to Java's built-in thread and synchronization features. This chapter discusses the more important types in the Concurrency Utilities, starting from atomic variables and followed by executors, Callable, and Future. Also included is a discussion of SwingWorker, which is a utility for writing asynchronous tasks in Swing.
The java.util.concurrent.atomic ...