25 |
|
final ReentrantLock bar = RLJBar.bar; |
26 |
|
final ReentrantLock end = RLJBar.End; |
27 |
|
final Condition endCondition = RLJBar.EndCondition; |
28 |
< |
if (RLJBar.OneKey) key = new Integer(0) ; // per-thread v. per iteration |
28 |
> |
if (RLJBar.OneKey) key = new Integer(0) ; // per-thread v. per iteration |
29 |
|
|
30 |
|
// The barrier has a number of interesting effects: |
31 |
< |
// 1. It enforces full LWP provisioning on T1. |
32 |
< |
// (nearly all workers park concurrently). |
33 |
< |
// 2. It gives the C2 compiler thread(s) a chance to run. |
34 |
< |
// By transiently quiescing the workings the C2 threads |
35 |
< |
// might avoid starvation. |
31 |
> |
// 1. It enforces full LWP provisioning on T1. |
32 |
> |
// (nearly all workers park concurrently). |
33 |
> |
// 2. It gives the C2 compiler thread(s) a chance to run. |
34 |
> |
// By transiently quiescing the workings the C2 threads |
35 |
> |
// might avoid starvation. |
36 |
|
// |
37 |
|
|
38 |
|
try { |
88 |
|
} |
89 |
|
|
90 |
|
|
91 |
< |
public class RLJBar // ProdConsTest |
91 |
> |
public class RLJBar // ProdConsTest |
92 |
|
{ |
93 |
|
|
94 |
|
public static final int ITERS = 10; |
95 |
< |
public static boolean OneKey = false ; // alloc once or once per iteration |
95 |
> |
public static boolean OneKey = false ; // alloc once or once per iteration |
96 |
|
|
97 |
|
public static boolean UseBar = false ; |
98 |
|
public static int nThreads = 100 ; |