Package com.qfs.chunk

Interface IConcurrentChunkLong

All Superinterfaces:
IArray, IArrayReader, IArrayWriter, IChunk<Long>, IChunkLong, IMemoryMonitored, IWritableArray
All Known Implementing Classes:
ArrayChunkLong, ArrayChunkLongNullable, DirectChunkLong

public interface IConcurrentChunkLong extends IChunkLong
An IChunkLong that supports some additional operations that are relevant for concurrent programming.
Author:
ActiveViam
  • Method Details

    • writeLongVolatile

      void writeLongVolatile(int position, long value)
      Writes a long primitive value in this chunk in a volatile fashion.
      Parameters:
      position - the position to write the value to
      value - the value to write
      See Also:
    • readLongVolatile

      long readLongVolatile(int position)
      Reads a long primitive value from this chunk in a volatile fashion.

      An exception will be thrown if the value is not of the right type.

      Parameters:
      position - the position to read the value from
      Returns:
      the value stored at the given position
      See Also:
    • compareAndSet

      boolean compareAndSet(int position, long expectedValue, long updatedValue)
      Atomically sets the given position of this chunk to the given updated value if the current value stored at this position equals the expected value.
      Parameters:
      position - the position to update
      expectedValue - the expected value
      updatedValue - the new value
      Returns:
      true if successful, or false if the actual value was not equal to the expected value