1 |
|
/* |
2 |
– |
* @test |
3 |
– |
* @synopsis multiple producers and single consumer using blocking queues |
4 |
– |
*/ |
5 |
– |
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
< |
* Expert Group and released to the public domain. Use, modify, and |
4 |
< |
* redistribute this code in any way without acknowledgement. |
3 |
> |
* Expert Group and released to the public domain, as explained at |
4 |
> |
* http://creativecommons.org/licenses/publicdomain |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.concurrent.*; |
68 |
|
oneRun(new SynchronousQueue<Integer>(), producers, iters); |
69 |
|
|
70 |
|
if (print) |
71 |
+ |
System.out.print("SynchronousQueue(fair) "); |
72 |
+ |
oneRun(new SynchronousQueue<Integer>(true), producers, iters); |
73 |
+ |
|
74 |
+ |
if (print) |
75 |
|
System.out.print("ArrayBlockingQueue(fair)"); |
76 |
|
oneRun(new ArrayBlockingQueue<Integer>(CAPACITY, true), producers, iters/10); |
77 |
|
} |