DoubleAdder

Guide to using DoubleAdder class.

We'll cover the following...

If you are interviewing, consider buying our number#1 course for Java Multithreading Interviews.

Overview

The DoubleAdder class offers an alternative mechanism to using atomic classes or lock-based counters in situations where a variable is repeatedly updated to compute stats or summary counts. In such scenarios throughput suffers significantly when several threads attempt to update a single variable. In case of locks, threads get suspended and resumed while in case of atomic ...