Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Multicore_magic.Atomic_array
Array of (potentially unboxed) atomic locations.
Where available, this uses an undocumented operation exported by the OCaml 5 runtime, caml_atomic_cas_field, which makes it possible to perform sequentially consistent atomic updates of record fields and array elements.
Hopefully a future version of OCaml provides more comprehensive and even more efficient support for both sequentially consistent and relaxed atomic operations on records and arrays.
unsafe_fenceless_set atomic_array index value writes the given value to the specified index of the atomic_array.
⚠️ The write is relaxed and may be reordered with respect to other reads and (non-initializing) writes in program order.
⚠️ No bounds checking is performed.
val unsafe_compare_and_set : 'at->int ->'a->'a-> bool
unsafe_compare_and_set atomic_array index before after atomically updates the specified index of the atomic_array to the after value in case it had the before value and returns a boolean indicating whether that was the case. This operation is sequentially consistent and may not be reordered with respect to other reads and writes in program order.