package kcas
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Kcas.LocSource
Shared memory locations.
Type of shared memory locations.
make initial creates a new shared memory location with the initial value.
compare_and_set r before after atomically updates the shared memory location r to the after value if the current value of r is the before value.
update r f repeats let b = get r in compare_and_set r b (f b) until it succeeds and then returns the b value. It is safe for the given function f to raise an exception to abort the update.
exchange r after atomically updates the shared memory location r to the after value and returns the current value (before the exchange).
set r after atomically updates the shared memory location r to the after value.
fetch_and_add r n atomically increments the value of r by n, and returns the current value (before the increment).