7 |
|
// Performance-tuning constant: |
8 |
|
static int sequentialThreshold; |
9 |
|
static long lastStealCount; |
10 |
< |
|
10 |
> |
|
11 |
|
public static void main(String[] args) throws Exception { |
12 |
|
int procs = 0; |
13 |
|
int num = 45; |
17 |
|
procs = Integer.parseInt(args[0]); |
18 |
|
if (args.length > 1) |
19 |
|
num = Integer.parseInt(args[1]); |
20 |
< |
if (args.length > 2) |
20 |
> |
if (args.length > 2) |
21 |
|
sequentialThreshold = Integer.parseInt(args[2]); |
22 |
|
} |
23 |
|
catch (Exception e) { |
25 |
|
return; |
26 |
|
} |
27 |
|
|
28 |
< |
|
28 |
> |
|
29 |
|
for (int reps = 0; reps < 2; ++reps) { |
30 |
< |
ForkJoinPool g = procs == 0? new ForkJoinPool() : |
30 |
> |
ForkJoinPool g = procs == 0? new ForkJoinPool() : |
31 |
|
new ForkJoinPool(procs); |
32 |
|
// g.setMaintainsParallelism(false); |
33 |
|
lastStealCount = g.getStealCount(); |