MemoryLocation

dev.tauri.choam.internal.mcas.MemoryLocation
See theMemoryLocation companion object
trait MemoryLocation[A]

Extension point for MCAS: an MCAS operation can be executed on any number of objects which conform to this interface.

However, the methods of this interface should only ever be called by the MCAS implementation. An MCAS operation is only safe and atomic if ALL reads and writes go through the MCAS implementation.

These are the low-level, primitive operations required by the MCAS implementation. They are easily implemented by, e.g., having an AtomicReference or similar. (For implementations of this interface, see SimpleMemoryLocation or the various Refs in the choam-core module.)

Some method names are prefixed by unsafe because these are necessarily side-effecting methods, and they're also very low-level. Other methods are not "unsafe", since they're mostly harmless.

Generally, this interface should not be used directly. Instead, use MCAS, or an even higher level abstraction.

Attributes

Companion
object
Source
MemoryLocation.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def id: Long

Attributes

Source
MemoryLocation.scala
def unsafeCasMarkerV(ov: WeakReference[AnyRef], nv: WeakReference[AnyRef]): Boolean

Used by EMCAS; volatile

Used by EMCAS; volatile

Attributes

Source
MemoryLocation.scala
def unsafeCasV(ov: A, nv: A): Boolean

volatile

volatile

Attributes

Source
MemoryLocation.scala
def unsafeCmpxchgMarkerR(ov: WeakReference[AnyRef], nv: WeakReference[AnyRef]): WeakReference[AnyRef]

Used by EMCAS; release

Used by EMCAS; release

Attributes

Source
MemoryLocation.scala
def unsafeCmpxchgR(ov: A, nv: A): A

release

release

Attributes

Source
MemoryLocation.scala
def unsafeCmpxchgV(ov: A, nv: A): A

volatile

volatile

Attributes

Source
MemoryLocation.scala

volatile

volatile

Attributes

Source
MemoryLocation.scala
def unsafeGetMarkerV(): WeakReference[AnyRef]

Used by EMCAS; volatile

Used by EMCAS; volatile

Attributes

Source
MemoryLocation.scala
def unsafeGetP(): A

plain

plain

Attributes

Source
MemoryLocation.scala
def unsafeGetV(): A

volatile

volatile

Attributes

Source
MemoryLocation.scala

volatile

volatile

Attributes

Source
MemoryLocation.scala
def unsafeSetP(nv: A): Unit

plain

plain

Attributes

Source
MemoryLocation.scala
def unsafeSetV(nv: A): Unit

volatile

volatile

Attributes

Source
MemoryLocation.scala