Currently, my program makes heavy use of AtomicInteger
s in order to keep track of running maximums of ints that are reported in parallel.
After reading about Java 8's new LongAccumulator
s, I had hoped to use an IntAccumulator
with max
as the accumulator function in order to accomplish my desired behavior with less thread contention. However it doesn't seem to exist.
Is there some reason that an IntAccumulator
wouldn't make sense? It seems plausible to me that there could be low level instructions that make an IntAdder
unnecessary, but an IntAccumulator
could represent more behaviors than can be captured by a low level instruction.
(If it's relevant at all, I intend to use these from Scala code)