Numeric (and accumulators)

Doug Lea dl at cs.oswego.edu
Mon Sep 17 06:23:37 PDT 2012


On 09/16/12 12:33, Brian Goetz wrote:
>>> But there's a much better move here -- take the opportunity to provide
>>> standardized forms of structured accumulators. ...

>> After fleshing out a bit, I'm now thinking that a variant of
>> this would be better in j.u.c as a refactoring of
>> jsr166e.LongAdder etc. The availability of non-thread-safe forms
>> as well would then just be an opportunistic byproduct.
>
> Yes, I had a note to write up why I thought this was a better strategy, but you
> beat me to it.
>

OK, I'll move further discussion to concurrency-interest list,
after deciding whether to go with the multiple implementation
styles I proposed versus just generalizing a bit some of the
current jsr166e dynamically striped classes to accept
lambdas (i.e., most likely keeping LongAdder, but replacing the
Double and min/max versions with lambda-ized forms.)
In some ways this would be a blown opportunity to try to
standardize usages: the notion of an Accumulator is central to
reductions of any form. But this might be one of the cases
where "notion" doesn't match up well enough with "JDK class"
to be worth doing.

-Doug





More information about the lambda-libs-spec-observers mailing list