Name
ReadWriteLock
Synopsis
This interface represents a pair of
Lock
objects with special locking behavior that is
useful for concurrent algorithms in which reader threads frequently
access a data structure and writer threads only infrequently modify
the structure. The Lock
returned by
readLock( )
may be locked by multiple threads at
the same time as long as no thread has the writeLock(
)
locked. See ReentrantReadWriteLock
for
a concrete implementation with implementation-specific locking
details.
public interface ReadWriteLock { // Public Instance Methods Lock readLock( ); Lock writeLock( ); }
Implementations
ReentrantReadWriteLock
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.