Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8261645

LongAccumulator:When initializing cell, you need to apply custom function

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      win10, jdk1.8.0_152

      A DESCRIPTION OF THE PROBLEM :
      LongAccumulator accumulator = new LongAccumulator( (left, right) -> left + Math.abs(right), 0);
      Multithreading: accumulator.accumulate(Math.random() > 0.9 ? 1 : -1);
      Striped64::longAccumulate : Cell r = new Cell( -1 ); rs[h & 1] = new Cell( -1 ); should be
      new Cell( fn != null ? fn.applyAsLong(0, x) : x )



            dl Doug Lea
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: