O'Reilly logo

Java 7: A Beginner's Tutorial (Third Edition) by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 24

Concurrency Utilities

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.

Atomic Variables

The java.util.concurrent.atomic ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required