public interface TwoLongReference extends net.openhft.chronicle.core.values.TwoLongValue, Byteable
long
values stored in off-heap memory or memory-mapped files,
facilitating direct, efficient manipulation of these values with support for various memory ordering semantics.
This interface extends TwoLongValue
, which provides the basic
operations for interacting with two separate long
values, and implements Byteable
to allow these values to be backed directly by a Bytes
storage mechanism.
Implementations must handle the storage and retrieval of these two long values, ensuring that operations on them respect the semantics of memory ordering prescribed by their method signatures. This interface is particularly useful in low-latency environments where operations directly on raw memory are necessary.
Key methods inherited from TwoLongValue
include:
getValue2()
, setValue2(long)
- Access and update the second long
value.getVolatileValue2()
, setVolatileValue2(long)
- Volatile read and write operations on the second long
value.addValue2(long)
- Atomically adds to the second long
value.compareAndSwapValue2(long, long)
- Attempts to set the second long
value if it matches an expected value.
The methods getValue()
and setValue(long)
from LongValue
apply to the first long
value, providing a consistent interface for operations on both values.
Implementations of this interface should ensure thread safety and proper synchronization to maintain consistency across threads, especially in multi-threaded environments. Additional optimizations and behaviors may be implemented but are not mandated by this interface.
This documentation should be paired with specific class-level details in concrete implementations to guide developers on the expected performance characteristics and operational specifics.
Byteable
,
TwoLongValue
addAtomicValue2, addValue2, compareAndSwapValue2, getValue2, getVolatileValue2, setOrderedValue2, setValue2, setVolatileValue2
addAtomicValue, addValue, close, compareAndSwapValue, getValue, getVolatileValue, getVolatileValue, isClosed, setMaxValue, setMinValue, setOrderedValue, setValue, setVolatileValue
address, bytesStore, bytesStore, lock, maxSize, offset, tryLock
Copyright © 2024. All rights reserved.