kumulant

Relaxed

Lock-free atomic cells. Many writers, no blocking.

For stats whose state is one independent cell (com.eignex.kumulant.stat.summary.SumStat, com.eignex.kumulant.stat.summary.MinStat, com.eignex.kumulant.stat.summary.MaxStat, the Bernoulli sum, the counter) Relaxed is exact because increments and CAS-min/max commute.

For Welford-coupled stats (com.eignex.kumulant.stat.summary.MeanStat, com.eignex.kumulant.stat.summary.VarianceStat, com.eignex.kumulant.stat.summary.MomentsStat) the cells race; independent racers reading a stale numerator against an updated denominator can produce results that drift by ULPs up to roughly 1e-5 relative under heavy contention. The drift does not compound and the stat never throws. Pick Relaxed on hot paths where a metric that is 0.001 percent off is preferable to writers blocking on a lock.

Properties

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int