Class Clutch.Pack

java.lang.Object
org.cojen.tupl.util.Latch
org.cojen.tupl.util.Clutch.Pack
Enclosing class:
Clutch

public static class Clutch.Pack extends Latch
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.
  • 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 support
      cores - must be at least 1 CPU core