Parent Directory
|
Revision Log
Revision 1.2 - (view) (download) (as text)
| 1 : | dl | 1.1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 : | <html> <head> | ||
| 3 : | <title>Locks</title> | ||
| 4 : | </head> | ||
| 5 : | |||
| 6 : | <body> | ||
| 7 : | |||
| 8 : | This package provides a framework for locking and waiting for | ||
| 9 : | conditions that is distinct from built-in synchronization and | ||
| 10 : | dl | 1.2 | monitors. The framework permits much greater flexibility in the use of |
| 11 : | locks and conditions, at the expense of more awkward syntax. | ||
| 12 : | dl | 1.1 | |
| 13 : | <p> | ||
| 14 : | The {@link java.util.concurrent.locks.Lock} interface supports locking | ||
| 15 : | disciplines that differ in semantics (reentrant, fair, etc), and that | ||
| 16 : | can be used in non-block-structured contexts including hand-over-hand | ||
| 17 : | and lock reordering algorithms. The main implementation is {@link | ||
| 18 : | java.util.concurrent.locks.ReentrantLock}. | ||
| 19 : | |||
| 20 : | <p> The {@link java.util.concurrent.locks.ReadWriteLock} interface | ||
| 21 : | similarly defines locks that may be shared among readers but are | ||
| 22 : | exclusive to writers. Only a single implementation, {@link | ||
| 23 : | java.util.concurrent.locks.ReentrantReadWriteLock}, is provided, since | ||
| 24 : | dl | 1.2 | it covers most standard usage contexts. But programmers may create |
| 25 : | dl | 1.1 | their own implementations to cover nonstandard requirements. |
| 26 : | |||
| 27 : | <p> The {@link java.util.concurrent.locks.Condition} interface | ||
| 28 : | describes the kinds of condition variables associated with monitors in | ||
| 29 : | dl | 1.2 | other concurrent languages, as well as pthreads-style "condvars". |
| 30 : | Their support reduces the need for tricky and/or inefficient solutions | ||
| 31 : | to many classic concurrent problems. To avoid compatibility issues, | ||
| 32 : | the names of Condition methods are different than the corresponding | ||
| 33 : | Object versions. | ||
| 34 : | |||
| 35 : | <p> The {@link LockSupport} class provides lower-level blocking | ||
| 36 : | and unblocking support that is useful only for those developers | ||
| 37 : | implementing their own customized lock classes. | ||
| 38 : | dl | 1.1 | |
| 39 : | <hr> | ||
| 40 : | <address><A HREF="http://gee.cs.oswego.edu/dl">Doug Lea</A></address> | ||
| 41 : | dl | 1.2 | <!-- hhmts start --> Last modified: Tue Aug 5 10:26:39 EDT 2003 <!-- hhmts end --> |
| 42 : | dl | 1.1 | </body> </html> |
| Doug Lea | ViewVC Help |
| Powered by ViewVC 1.0.8 |