On Wed, 24 Aug 2022 18:15:17 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:
> [JDK-8026344](https://bugs.openjdk.org/browse/JDK-8026344) added tests that > subtly contradict the contract for `{Double,Long}Accumulator`-s, which breaks > the tests on some platforms even in the single-threaded case. > > They use accumulators with binary plus as update function and using non-zero > values as identity, which breaks once accumulators create many cells, reset > their values to identity, and then apply the function over them, producing > unexpected values. > > See the investigation on RISC-V here: > https://mail.openjdk.org/pipermail/riscv-port-dev/2022-August/000594.html > > We can do what `DoubleAccumulator` javadocs do as the sample, namely: "For > example, to maintain a running maximum value, you could supply Double::max > along with Double.NEGATIVE_INFINITY as the identity." > > Additional testing: > - [x] Linux x86_64, `java/util/concurrent` tests Thank you all! ------------- PR: https://git.openjdk.org/jdk/pull/10002