This package provides a framework for locking and waiting for conditions that is distinct from built-in synchronization and monitors. The framework permits much greater flexibility in the use of locks and conditions, at the expense of more awkward syntax.

To be continued.

The {@link java.util.concurrent.locks.Lock} interface supports locking disciplines that differ in semantics (reentrant, fair, etc), and that can be used in non-block-structured contexts including hand-over-hand and lock reordering algorithms. The main implementation is {@link java.util.concurrent.locks.ReentrantLock}.

The {@link java.util.concurrent.locks.ReadWriteLock} interface similarly defines locks that may be shared among readers but are exclusive to writers. Only a single implementation, {@link java.util.concurrent.locks.ReentrantReadWriteLock}, is provided, since it covers all standard usage contexts. But programmers may create their own implementations to cover nonstandard requirements.

The {@link java.util.concurrent.locks.Condition} interface describes the kinds of condition variables associated with monitors in other concurrent languages, as well as pthreads-style condvars. Their support reduces the need for tricky and/or inefficient solutions to many classic concurrent problems. To avoid compatibility problems, the names of Condition methods are different than Object versions.


Doug Lea
Last modified: Mon Jul 7 20:39:00 EDT 2003