Class Clutch.Pack
java.lang.Object
org.cojen.tupl.util.Latch
org.cojen.tupl.util.Clutch.Pack
- Enclosing class:
Clutch
Sharable object for supporting contended clutches. Memory overhead (in bytes) is
proportional to
(number of slots) * (number of cores)
. The number of slots
should be at least 16, to minimize cache line contention. As a convenience, this class
also extends the Latch class, but the latching features aren't used here.-
Nested Class Summary
Nested classes/interfaces inherited from class org.cojen.tupl.util.Latch
Latch.Condition
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.cojen.tupl.util.Latch
acquireExclusive, acquireExclusiveInterruptibly, acquireShared, acquireSharedInterruptibly, acquireSharedUncontended, acquireSharedUncontendedNanos, downgrade, hasQueuedThreads, release, releaseEither, releaseExclusive, releaseShared, toString, tryAcquireExclusive, tryAcquireExclusiveNanos, tryAcquireShared, tryAcquireSharedNanos, tryUpgrade, uponExclusive
-
Constructor Details
-
Pack
public Pack(int numSlots) - Parameters:
numSlots
- amount of contended clutches that this pack can support
-
Pack
public Pack(int numSlots, int cores) - Parameters:
numSlots
- amount of contended clutches that this pack can supportcores
- must be at least 1 CPU core
-