ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/extra166y/DoubleCumulateDemo.java
(Generate patch)

Comparing jsr166/src/test/extra166y/DoubleCumulateDemo.java (file contents):
Revision 1.2 by jsr166, Mon Nov 16 04:16:42 2009 UTC vs.
Revision 1.4 by jsr166, Tue Mar 15 19:47:04 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7  
# Line 40 | Line 40 | public class DoubleCumulateDemo {
40              System.out.printf("seq  :  %9.5f\n", elapsed);
41          }
42  
43 <        ForkJoinPool fjp = new ForkJoinPool(2);
44 <        for (int i = 2; i <= NCPU; i <<= 1) {
45 <            fjp.setParallelism(i);
46 <            oneRun(fjp, array, i, reps, tests);
47 <        }
48 <        for (int i = NCPU; i >= 1; i >>>= 1) {
49 <            fjp.setParallelism(i);
50 <            oneRun(fjp, array, i, reps, tests);
43 >        for (int sweeps = 0; sweeps < 2; ++sweeps) {
44 >            for (int i = 2; i <= NCPU; i <<= 1) {
45 >                ForkJoinPool fjp = new ForkJoinPool(i);
46 >                oneRun(fjp, array, i, reps, tests);
47 >                fjp.shutdown();
48 >            }
49 >            for (int i = NCPU; i >= 1; i >>>= 1) {
50 >                ForkJoinPool fjp = new ForkJoinPool(i);
51 >                oneRun(fjp, array, i, reps, tests);
52 >                fjp.shutdown();
53 >            }
54          }
52        fjp.shutdown();
55      }
56  
57      static void oneRun(ForkJoinPool fjp,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines