Skip to main content
PreparationZone Logo
PreparationZone
Back to Java

Java · Medium · Pro

LongAdder vs AtomicLong — high contention counters?

JavaConcurrencySenior
Model answerPreview

LongAdder vs AtomicLong

LongAdder stripes increments across cells under contention—higher throughput for many threads counting events. AtomicLong is simpler and better when contention is low or…