--- jsr166/src/test/extra166y/DoubleCumulateDemo.java 2009/11/16 04:16:42 1.2 +++ jsr166/src/test/extra166y/DoubleCumulateDemo.java 2010/11/25 12:38:35 1.3 @@ -40,16 +40,18 @@ public class DoubleCumulateDemo { System.out.printf("seq : %9.5f\n", elapsed); } - ForkJoinPool fjp = new ForkJoinPool(2); - for (int i = 2; i <= NCPU; i <<= 1) { - fjp.setParallelism(i); - oneRun(fjp, array, i, reps, tests); + for (int sweeps = 0; sweeps < 2; ++sweeps) { + for (int i = 2; i <= NCPU; i <<= 1) { + ForkJoinPool fjp = new ForkJoinPool(i); + oneRun(fjp, array, i, reps, tests); + fjp.shutdown(); + } + for (int i = NCPU; i >= 1; i >>>= 1) { + ForkJoinPool fjp = new ForkJoinPool(i); + oneRun(fjp, array, i, reps, tests); + fjp.shutdown(); + } } - for (int i = NCPU; i >= 1; i >>>= 1) { - fjp.setParallelism(i); - oneRun(fjp, array, i, reps, tests); - } - fjp.shutdown(); } static void oneRun(ForkJoinPool fjp,