org.openjdk.jcstress.tests.atomicity.varHandles.fields.CAETest.CompareAndExchangeLong

Tests atomicity of compareAndExchange.

JVM options: [-client, -XX:-TieredCompilation] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 349260 ACCEPTABLE actor2 update successfully
0, -1, -1 527990 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic

JVM options: [-server, -XX:+UnlockDiagnosticVMOptions, -XX:+StressLCM, -XX:+StressGCM] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 90284 ACCEPTABLE actor2 update successfully
0, -1, -1 189936 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic

JVM options: [-XX:TieredStopAtLevel=1] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 147081 ACCEPTABLE actor2 update successfully
0, -1, -1 313589 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic

JVM options: [-server] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 204793 ACCEPTABLE actor2 update successfully
0, -1, -1 911117 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic

JVM options: [-server, -XX:-TieredCompilation] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 235345 ACCEPTABLE actor2 update successfully
0, -1, -1 357445 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic

JVM options: [-server, -XX:-TieredCompilation, -XX:+UnlockDiagnosticVMOptions, -XX:+StressLCM, -XX:+StressGCM] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 116445 ACCEPTABLE actor2 update successfully
0, -1, -1 81605 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic

JVM options: [-Xint] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 52803 ACCEPTABLE actor2 update successfully
0, -1, -1 44607 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic

JVM options: [-client] Iterations: 5 Time: 200

Observed state Occurrence Expectation Interpretation
-2, 0, -2 70743 ACCEPTABLE actor2 update successfully
0, -1, -1 300717 ACCEPTABLE actor1 update successfully
0, 0, -1 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, -2 0 FORBIDDEN This won't happen because compareAndExchange is atomic
0, 0, 0 0 FORBIDDEN This won't happen because compareAndExchange is atomic