ThreadContext

dev.tauri.choam.mcas.Mcas$.ThreadContext
sealed trait ThreadContext

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def random: ThreadLocalRandom

Attributes

Returns:

a ThreadLocalRandom valid for the current thread

def readDirect[A](ref: MemoryLocation[A]): A

Attributes

Returns:

the current value of ref, as if read by readIntoHwd(ref).nv.

Attributes

Returns:

the current value and version of ref in a word descriptor object. The value and version are guaranteed to be consistent with each other. The descriptor's .ov and .nv are guaranteed to be the same.

Starts building a descriptor (its .validTs will be the current global sersion).

Starts building a descriptor (its .validTs will be the current global sersion).

Attributes

Concrete methods

final def addCasFromInitial[A](desc: HalfEMCASDescriptor, ref: MemoryLocation[A], ov: A, nv: A): HalfEMCASDescriptor
final def addCasWithVersion[A](desc: HalfEMCASDescriptor, ref: MemoryLocation[A], ov: A, nv: A, version: Long): HalfEMCASDescriptor

Utility to first try to read from the log, and only from the ref if not found

Utility to first try to read from the log, and only from the ref if not found

Attributes

final def singleCasDirect[A](ref: MemoryLocation[A], ov: A, nv: A): Boolean

Tries to perform a "bare" 1-CAS, without changing the global version. This breaks opacity guarantees! It may change the value of a ref without changing its version!

Tries to perform a "bare" 1-CAS, without changing the global version. This breaks opacity guarantees! It may change the value of a ref without changing its version!

Attributes

Attributes

Returns:

a snapshot of desc.

Tries to perform the ops in desc, with adding a version-CAS (if not read-only).

Tries to perform the ops in desc, with adding a version-CAS (if not read-only).

Attributes

Returns:

either EmcasStatus.Successful (if successful); EmcasStatus.FailedVal (if failed due to an expected value not matching); or the current global version (if failed due to the version being newer than desc.validTs).

Like tryPerform, but returns whether it was successful

Like tryPerform, but returns whether it was successful

Attributes

final def tryPerformSingleCas[A](ref: MemoryLocation[A], ov: A, nv: A): Boolean

Tries to perform a 1-CAS, but also handles versions. Equivalent to creating a descriptor containing a single op, and calling tryPerformOk on it (but may be more efficient).

Tries to perform a 1-CAS, but also handles versions. Equivalent to creating a descriptor containing a single op, and calling tryPerformOk on it (but may be more efficient).

Attributes