Package com.qfs.chunk

Interface IConcurrentChunkInteger

All Superinterfaces:
IArray, IArrayReader, IArrayWriter, IChunk<Integer>, IChunkInteger, IMemoryMonitored, IWritableArray
All Known Implementing Classes:
ArrayChunkInteger, ArrayChunkIntegerNullable, DirectChunkInteger

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

    • writeIntVolatile

      void writeIntVolatile(int position, int value)
      Writes an int 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:
    • readIntVolatile

      int readIntVolatile(int position)
      Reads an int 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, int expectedValue, int 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