Class StripedCounters<T>
java.lang.Object
org.infinispan.commons.util.concurrent.StripedCounters<T>
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(AtomicLongFieldUpdater<T> updater, T stripe, long delta) longget(AtomicLongFieldUpdater<T> updater) voidincrement(AtomicLongFieldUpdater<T> updater, T stripe) voidreset(AtomicLongFieldUpdater<T> updater)
-
Constructor Details
-
StripedCounters
-
-
Method Details
-
increment
-
add
-
get
-
reset
-
stripeForCurrentThread
-