Tests if the synchronized section provides the essential barriers
java.specification.name | Java Platform API Specification |
java.specification.vendor | Oracle Corporation |
java.specification.version | 10 |
java.vendor | Oracle Corporation |
java.version | 10-internal |
java.vm.name | OpenJDK 64-Bit Server VM |
java.vm.vendor | Oracle Corporation |
java.vm.version | 10-internal+0-adhoc.buildslave.jdk10 |
os.arch | aarch64 |
os.name | Linux |
os.version | 4.4.0-63-generic |
TC 1 | JVM options: [] Iterations: 5 Time: 200 |
TC 2 | JVM options: [-XX:+UnlockDiagnosticVMOptions, -XX:+StressLCM, -XX:+StressGCM] Iterations: 5 Time: 200 |
TC 3 | JVM options: [-XX:-TieredCompilation] Iterations: 5 Time: 200 |
TC 4 | JVM options: [-XX:-TieredCompilation, -XX:+UnlockDiagnosticVMOptions, -XX:+StressLCM, -XX:+StressGCM] Iterations: 5 Time: 200 |
TC 5 | JVM options: [-XX:TieredStopAtLevel=1] Iterations: 5 Time: 200 |
TC 6 | JVM options: [-Xint] Iterations: 5 Time: 200 |
Observed state | TC 1 | TC 2 | TC 3 | TC 4 | TC 5 | TC 6 | Expectation | Interpretation |
---|---|---|---|---|---|---|---|---|
0, 0 | 753612 | 2139332 | 688544 | 3826348 | 4020013 | 112003 | ACCEPTABLE | The write to $b is not visible yet; we can observe whatever in $a. |
0, 2 | 13999 | 154604 | 50374 | 43456 | 227742 | 2062 | ACCEPTABLE | The write to $b is not visible yet; we can observe whatever in $a. |
1, 0 | 1613 | 3 | 2136 | 73 | 0 | 0 | ACCEPTABLE_INTERESTING | The write to $b is observed, but write to $a is not. This is the counter-intuitive behavior,but the coding pattern is incorrect: alone "sync" barrier is not enough to get the properacquire/release semantics. |
1, 2 | 4583044 | 4101349 | 6831764 | 2060581 | 4991773 | 67883 | ACCEPTABLE | The write to $b is observed, expected to see $a == 1. |
OK | OK | OK | OK | OK | OK |