RFR 8005311: Add Scalable Updatable Variables, DoubleAccumulator, DoubleAdder, LongAccumulator, LongAdder (original) (raw)

Doug Lea dl at cs.oswego.edu
Tue Jan 8 15:32:35 UTC 2013


On 01/08/13 10:01, Peter Levart wrote:

- accumulate(long x) returns the post-modification value of the modified cell or base (the returned value of the function that was used to update the state)

To avoid what would be a serious and common usage error (people treating the return value as if it were the aggregate result), this would need to be exposed only in a suitably-name "protected" method. OK?

- the accumulator function is always called for initial allocations of cells (with identity value as 1st argument, like when accumulating on the base) - the original code optimizes this situation and just installs the parameter x into the cell.

Good idea; thanks. I see that this tiny and cheap change would just barely widen applicability.

-Doug



More information about the core-libs-dev mailing list