ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/COWALAddIfAbsentLoops.java
(Generate patch)

Comparing jsr166/src/test/loops/COWALAddIfAbsentLoops.java (file contents):
Revision 1.2 by jsr166, Fri Apr 5 21:11:07 2013 UTC vs.
Revision 1.3 by jsr166, Sat Apr 6 20:10:54 2013 UTC

# Line 13 | Line 13 | import java.util.concurrent.atomic.*;
13   */
14   public class COWALAddIfAbsentLoops {
15  
16 <    static final int SIZE = 35000;
16 >    static final int SIZE = Integer.getInteger("size", 35000);
17  
18      /**
19       * Set to 1 for  0% cache hit ratio (every addIfAbsent a cache miss).
20       * Set to 2 for 50% cache hit ratio.
21       */
22 <    static final int CACHE_HIT_FACTOR = 1;
22 >    static final int CACHE_HIT_FACTOR = Integer.getInteger("cache.hit.factor", 1);
23 >
24 >    static final int MAX_STRIPES = Integer.getInteger("max.stripes", 3);
25 >
26 >    static final int REPS = Integer.getInteger("reps", 3);
27  
28      public static void main(String[] args) throws Exception {
29 <        for (int reps = 0; reps < 4; ++reps) {
30 <            for (int i = 1; i <= 4; ++i)
29 >        for (int reps = 0; reps < REPS; ++reps) {
30 >            for (int i = 1; i <= MAX_STRIPES; ++i)
31                  test(i);
32          }
33      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines