Class StripedCounters<T>

java.lang.Object
org.infinispan.commons.util.concurrent.StripedCounters<T>

public final class StripedCounters<T> extends Object
Duplicates a set of counters in a set of stripes, so that multiple threads can increment those counters without too much contention.

Callers must first obtain a stripe for the current thread with stripeForCurrentThread(), then use increment(AtomicLongFieldUpdater, Object) or add(AtomicLongFieldUpdater, Object, long) to update one or more counters in that stripe. They must also provide a AtomicLongFieldUpdater to access a specific counter in the stripe - it should be defined as static final so that it can be inlined by the JIT.

Since:
9.0
Author:
Dan Berindei