1 |
|
/* |
2 |
|
* Written by Bill Scherer and Doug Lea with assistance from members |
3 |
|
* of JCP JSR-166 Expert Group and released to the public domain, as |
4 |
< |
* explained at http://creativecommons.org/licenses/publicdomain |
4 |
> |
* explained at http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.concurrent.*; |
12 |
|
static final int NCPUS = Runtime.getRuntime().availableProcessors(); |
13 |
|
|
14 |
|
static final int DEFAULT_THREADS = NCPUS + 2; |
15 |
< |
static final long DEFAULT_PATIENCE_NANOS = 500000; |
15 |
> |
static final long DEFAULT_PATIENCE_NANOS = 100000; |
16 |
|
static final long DEFAULT_TRIAL_MILLIS = 10000; |
17 |
|
|
18 |
|
public static void main(String[] args) throws Exception { |
106 |
|
double failRate = (fails * 100.0) / (double) iters; |
107 |
|
System.out.printf("%9d it/s ", rate); |
108 |
|
System.out.printf("%9d ns/it", npt); |
109 |
< |
System.out.printf("%9.5f%% fails", failRate); |
109 |
> |
System.out.printf("%9.5f%% fails ", failRate); |
110 |
> |
System.out.print(fails); |
111 |
|
System.out.println(); |
112 |
|
// x.printStats(); |
113 |
|
} |
114 |
|
|
114 |
– |
|
115 |
|
static final class Runner implements Runnable { |
116 |
|
final Exchanger exchanger; |
117 |
|
final CountDownLatch start; |