Module Await_scratchpad.MakeSource

Parameters

module T : sig ... end

Signature

Sourcetype t : value mod contended non_float portable

t represents an ephemeral value of type T.t that may be accessed concurrently without contention. It is intended to replace static scratch space. t persists shards T.t value and provides a fresh value if the current shard is in use.

Sourceval create : ?shards:int -> unit -> t @@ portable

create ~shards () is a scratchpad that persists at least shards values.

Sourceval access : t @ local -> f:(T.t -> 'a @ portable contended) @ local portable unyielding -> 'a @ portable contended @@ portable

Provides uncontended access to an ephemeral value of type T.t.

Sourceval iter : t @ local -> f:(T.t -> unit) @ local portable unyielding -> unit @@ portable

Like access, but returns unit.