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 |
|
import jsr166y.*; |
82 |
|
} |
83 |
|
int pass = 0; |
84 |
|
int ps = 2; |
85 |
< |
ForkJoinPool fjp = new ForkJoinPool(ps); |
85 |
> |
ForkJoinPool fjp = new ForkJoinPool(); |
86 |
|
ParallelArray<Rand> pa = ParallelArray.createUsingHandoff(array, fjp); |
87 |
|
for (;;) { |
88 |
|
last = System.nanoTime(); |
111 |
|
ps >>>= 1; |
112 |
|
} |
113 |
|
// pa.apply(nextRand); |
114 |
< |
fjp.setParallelism(ps); |
114 |
> |
// fjp.setParallelism(ps); |
115 |
|
} |
116 |
|
fjp.shutdownNow(); |
117 |
|
fjp.awaitTermination(1, TimeUnit.SECONDS); |