package kcas_data

  1. Overview
  2. Docs

Module Kcas_data.AccumulatorSource

Scalable accumulator.

A scalable accumulator can be used to scalably accumulate an integer value in parallel as long as the accumulated value is read infrequently.

Common interface

Sourcetype t

The type of a scalable accumulator.

Sourceval make : int -> t

make n returns a new accumulator whose initial value is n.

Compositional interface

Sourcemodule Xt : sig ... end

Explicit transaction log passing on accumulators.

Non-compositional interface

Sourceval add : t -> int -> unit

add a n increments the value of the accumulator a by n. add operations can be performed scalably in parallel.

Sourceval incr : t -> unit

incr a is equivalent to add a 1.

Sourceval decr : t -> unit

decr a is equivalent to add a (-1).

Sourceval get : t -> int

get a returns the current value of the accumulator.

CAUTION: Performing a get is expensive and can limit scalability.

Sourceval set : t -> int -> unit

set a n sets the current value of the accumulator a to n.

OCaml

Innovation. Community. Security.