127 |
|
int position; |
128 |
|
int total; |
129 |
|
|
130 |
< |
Runner(int id, Map<Integer,Integer> map, Integer[] key, CyclicBarrier barrier) { |
130 |
> |
Runner(int id, Map<Integer,Integer> map, Integer[] key, CyclicBarrier barrier) { |
131 |
|
this.map = map; |
132 |
|
this.key = key; |
133 |
|
this.barrier = barrier; |
137 |
|
} |
138 |
|
|
139 |
|
int step() { |
140 |
< |
// random-walk around key positions, bunching accesses |
140 |
> |
// random-walk around key positions, bunching accesses |
141 |
|
int r = rng.next(); |
142 |
|
position += (r & 7) - 3; |
143 |
|
while (position >= key.length) position -= key.length; |