Kcasval ref : 'a -> 'a refref x returns a reference on a shared memory ceils containing the value x
mk_cas a o n returns a new CAS value, which when performed, updates the reference a to n if the current content of a is o
val set : 'a ref -> 'a -> unitset r n updates the reference r to value n directly. Not Safe to use with shared memory !
val cas : 'a ref -> 'a -> 'a -> boolcas r e u updates the reference r to value u if the current content of r is e.
val commit : t -> boolcommit c performs the CAS c and returns true if the CAS is successful.
val kCAS : t list -> boolkCAS l performs a lock-free multi-word CAS and returns true if the multi-word CAS is successful.
kCAS requires ref of provided operations to follow a global total order. To eliminate a class of bugs kCAS presorts provided operations. If the operations are given in either ascending or descending order of get_id then the presort is done in linear time O(n). Otherwise presort may take linearithmic time O(n log n).
val get : 'a ref -> 'aget a reads the value contained in reference a.
val get_id : 'a ref -> intget_id a returns the unique id of the reference a.
val try_map : 'a ref -> ('a -> 'a option) -> 'a cas_resulttry_map r f invokes f c, where c is the result of get r. If the result of f c is None, then Aborted is returned. If the result of f c is Some v, then attempt to CAS update r from c to v. If the CAS succeeds, then Success c is returned. If the CAS fails, then Failed is returned.
val map : 'a ref -> ('a -> 'a option) -> 'a cas_resultLike try_map but retries on CAS failure. Hence, map r f never returns Failed.
val incr : int ref -> unitincr r atomically increments r
val decr : int ref -> unitdecr r atomically decrements r
module type Backoff = sig ... endmodule type W1 = sig ... end