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

Comparing jsr166/src/test/loops/AsyncNQueensCS.java (file contents):
Revision 1.1 by dl, Sun Sep 19 12:55:36 2010 UTC vs.
Revision 1.2 by jsr166, Mon Sep 20 20:42:37 2010 UTC

# Line 23 | Line 23 | public final class AsyncNQueensCS extend
23  
24      /** for time conversion */
25      static final long NPS = (1000L * 1000 * 1000);
26 <    
26 >
27      public static void main(String[] args) throws Exception {
28          int procs = 0;
29          try {
# Line 35 | Line 35 | public final class AsyncNQueensCS extend
35              return;
36          }
37          for (int reps = 0; reps < 2; ++reps) {
38 <            ForkJoinPool g = procs == 0? new ForkJoinPool() :
38 >            ForkJoinPool g = procs == 0? new ForkJoinPool() :
39                  new ForkJoinPool(procs);
40              System.out.println("Number of procs=" + g.getParallelism());
41              lastStealCount = g.getStealCount();
42              for (int i = FIRST_SIZE; i <= LAST_SIZE; i++)
43                  test(g, i);
44 <            g.shutdown();    
44 >            g.shutdown();
45          }
46      }
47  
# Line 63 | Line 63 | public final class AsyncNQueensCS extend
63          lastStealCount = sc;
64          System.out.printf(" Steals/t: %5d", ns/ps);
65          System.out.println();
66 <    }            
66 >    }
67  
68 <    // Boards are represented as arrays where each cell
68 >    // Boards are represented as arrays where each cell
69      // holds the column number of the queen in that row
70  
71      final int[] sofar;
72      volatile int solutions;
73 <    AsyncNQueensCS(AsyncNQueensCS parent, int[] a) {
73 >    AsyncNQueensCS(AsyncNQueensCS parent, int[] a) {
74          super(parent);
75 <        this.sofar = a;  
75 >        this.sofar = a;
76      }
77  
78      public final boolean exec() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines