Class BBHeader.ReadAndWriteCounterRef

Direct Known Subclasses:
BoundedBuffer.RingBuffer
Enclosing class:
BBHeader

abstract static class BBHeader.ReadAndWriteCounterRef extends BBHeader.PadWriteCounter
Enforces a memory layout to avoid false sharing by padding the write count.
  • Field Details

    • WRITE_OFFSET

      static final long WRITE_OFFSET
    • writeCounter

      volatile long writeCounter
  • Constructor Details

    • ReadAndWriteCounterRef

      ReadAndWriteCounterRef(int writes)
  • Method Details

    • relaxedWriteCounter

      long relaxedWriteCounter()
    • casWriteCounter

      boolean casWriteCounter(long expect, long update)