Module Portable_kernel

module Atomic : sig ... end

An atomic (mutable) reference to a value of type 'a.

module Atomic_array : sig ... end
module Capsule = Capsule
module Subatomic : sig ... end

A Subatomic.t is a hybrid between ref and Atomic.t. When you have uncontended access to a subatomic, you can do non-atomic reads/writes to it, like a ref. When you have shared access to a subatomic, you can do atomic reads/writes to it, like an Atomic. Nothing can be done to a contended subatomic.