Page
Library
Module
Module type
Parameter
Class
Class type
Source
Kcas_data.AccumulatorSourceScalable accumulator.
A scalable accumulator can be used to scalably accumulate an integer value in parallel as long as the accumulated value is read infrequently.
The type of a scalable accumulator.
make n returns a new accumulator whose initial value is n.
The optional n_way argument can be used to specify a desired level of parallelism, i.e. maximum number of non-interfering parallel updates. The default value is chosen to strike a balance between scalability and memory use and a given value may be adjusted by the implementation.
n_way_of a returns the maximum number of non-interfering parallel updates supported by the accumulator a.
NOTE: The returned value may not be the same as given to make.
add a n increments the value of the accumulator a by n. add operations can be performed scalably in parallel.
get a returns the current value of the accumulator.
CAUTION: Performing a get is expensive and can limit scalability.