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 |
5 |
+ |
*/ |
6 |
+ |
|
7 |
|
//import jsr166y.*; |
8 |
|
import java.util.*; |
9 |
|
import java.util.concurrent.*; |
23 |
|
num = Integer.parseInt(args[1]); |
24 |
|
} |
25 |
|
catch (Exception e) { |
26 |
< |
System.out.println("Usage: java DynamicLeftSpineFib <threads> <number> [<sequntialThreshold>]"); |
26 |
> |
System.out.println("Usage: java DynamicLeftSpineFib <threads> <number> [<sequentialThreshold>]"); |
27 |
|
return; |
28 |
|
} |
29 |
|
|
30 |
|
|
31 |
|
for (int reps = 0; reps < 2; ++reps) { |
32 |
< |
ForkJoinPool g = procs == 0? new ForkJoinPool() : |
32 |
> |
ForkJoinPool g = (procs == 0) ? |
33 |
> |
new ForkJoinPool() : |
34 |
|
new ForkJoinPool(procs); |
35 |
|
lastStealCount = g.getStealCount(); |
36 |
|
for (int i = 0; i < 10; ++i) { |