[concurrency-interest] LongAdder (was: StripedAdder) and LongAdderTable

Rodrigo Kumpera kumpera at gmail.com
Fri Sep 9 15:42:20 EDT 2011

On Sun, Jul 31, 2011 at 11:55 AM, Doug Lea <dl at cs.oswego.edu> wrote:

> It is much nicer not to have to decide ahead of time that
> a program will have enough threads updating a variable
> to need a class that can adaptively spread out contention.
> So a reworked version of StripedAdder is now known as "LongAdder".
> It is a variant of AtomicLong with a stripped-down API (suitable
> only for adding and counting), that expands to use striping
> when needed while avoiding noticeable overhead when not needed.
This class doesn't look to be 32bits safe as it does non-atomic load/store
of 64bits types.
It certainly is not a problem on IA32 systems with TSO, but definitely an
issue ppc or arm.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20110909/15c0eb8d/attachment.html>

More information about the Concurrency-interest mailing list