atomic

Memory-order markers and fixed-width integer atomic operations over one referenced integer object.


Memory orders

Examples

"atomic" use
"control" use

{} () {} [
  ACQUIRE printStack _:;
  RELEASE printStack _:;
] "main" exportFunction

Expected Output During Compilation

{
  MEMORY_ORDER: ();
  ORDER: "acquire" virtual;
}
{
  MEMORY_ORDER: ();
  ORDER: "release" virtual;
}

Supported schemas


Operation summary


atomicExchange (value ref order -- previousValue)

Atomically stores value and returns the previous value.


atomicLoad (ref order -- value)

Atomically loads the current value from ref.


atomicOr (value ref order -- previousValue)

Atomically applies bitwise OR with value and returns the previous value.


atomicStore (value ref order --)

Atomically stores value into ref.


atomicXor (value ref order -- previousValue)

Atomically applies bitwise XOR with value and returns the previous value.


See also