public abstract class FastThreadLocal extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BYTE_OFFSET
Useful value for
FastThreadLocal.setMaxOffset(int) : The thread local variable has an offset that can be
expressed as a signed 8-bit value. |
static int |
FIRST_CACHE_LINE
Useful value for
FastThreadLocal.setMaxOffset(int) : The thread local variable is in the first cache line
of the memory block. |
Modifier and Type | Method and Description |
---|---|
org.graalvm.word.LocationIdentity |
getLocationIdentity()
Returns the
LocationIdentity used for memory accesses performed by the get
and set methods of the subclasses. |
int |
getMaxOffset() |
<T extends FastThreadLocal> |
setMaxOffset(int maxOffset)
Sets the maximum offset of this thread local variable in the memory block reserved for each
thread.
|
public static final int FIRST_CACHE_LINE
FastThreadLocal.setMaxOffset(int)
: The thread local variable is in the first cache line
of the memory block. This allows grouping of the most frequently accessed variables.
We are not using a real cache line size, but instead assume that 64 bytes is the common
minimum size on all platforms.public static final int BYTE_OFFSET
FastThreadLocal.setMaxOffset(int)
: The thread local variable has an offset that can be
expressed as a signed 8-bit value. Some architectures, e.g. AMD64, need fewer bytes to encode
such offsets.public org.graalvm.word.LocationIdentity getLocationIdentity()
LocationIdentity
used for memory accesses performed by the get
and set
methods of the subclasses.public <T extends FastThreadLocal> T setMaxOffset(int maxOffset)
public int getMaxOffset()