1 |
– |
/* |
2 |
– |
* @test |
3 |
– |
* @synopsis Exercise multithreaded maps, by default |
4 |
– |
* ConcurrentHashMap. Each thread does a random walk though elements |
5 |
– |
* of "key" array. On each iteration, it checks if table includes key. |
6 |
– |
* If absent, with probablility pinsert it inserts it, and if present, |
7 |
– |
* with probablility premove it removes it. (pinsert and premove are |
8 |
– |
* expressed as percentages to simplify parsing from command line.) |
9 |
– |
*/ |
1 |
|
/* |
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 |
|
|
16 |
– |
|
7 |
|
import java.util.*; |
8 |
|
import java.util.concurrent.*; |
9 |
|
|