ThreadContext

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

Attributes

Source
Mcas.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def impl: Mcas

The Mcas instance from which this context was retrieved

The Mcas instance from which this context was retrieved

Attributes

Source
Mcas.scala
def random: ThreadLocalRandom

Attributes

Returns

a ThreadLocalRandom valid for the current thread

Source
Mcas.scala

Attributes

Returns

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

Source
Mcas.scala

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.

Source
Mcas.scala
def refIdGen: RefIdGen

Attributes

Returns

the RefIdGen of the current thread (or a thread-safe one)

Source
Mcas.scala
def start(): Descriptor

Reads the global version, and Starts building a descriptor (its .validTs will be the current global version).

Reads the global version, and Starts building a descriptor (its .validTs will be the current global version).

Attributes

Source
Mcas.scala

Concrete methods

Attributes

Source
Mcas.scala

Attributes

Source
Mcas.scala

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

Source
Mcas.scala
final def singleCasDirect[A](ref: MemoryLocation[A], ov: A, nv: A): Boolean

Tries to perform a "bare" 1-CAS, without changing the global 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

Source
Mcas.scala

Attributes

Returns

a snapshot of desc.

Source
Mcas.scala

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).

Source
Mcas.scala

Attributes

Source
Mcas.scala

Attributes

Source
Mcas.scala

Like tryPerform, but returns whether it was successful

Like tryPerform, but returns whether it was successful

Attributes

Source
Mcas.scala
final def tryPerformSingleCas[A](ref: MemoryLocation[A], ov: A, nv: A): Boolean

Tries to perform a 1-CAS, but also handles versions.

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

Source
Mcas.scala