Skip to content

Instantly share code, notes, and snippets.

@jasonk000
Created April 2, 2019 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonk000/5f3d1077dea17c18b5f415cfad048c27 to your computer and use it in GitHub Desktop.
Save jasonk000/5f3d1077dea17c18b5f415cfad048c27 to your computer and use it in GitHub Desktop.
RUN COMPLETE.
RUN RESULTS:
------------------------------------------------------------------------------------------------------------------------
*** INTERESTING tests
Some interesting behaviors observed. This is for the plain curiosity.
0 matching test results.
*** FAILED tests
Strong asserts were violated. Correct implementations should have no assert failures here.
4 matching test results.
[FAILED] org.sample.ConcurrencyTestNonVolatile
(JVM args: [-XX:-TieredCompilation])
Observed state Occurrences Expectation Interpretation
-1 262,745,340 ACCEPTABLE Seeing the full value.
-4294967296 149,763 FORBIDDEN Other cases are forbidden.
0 9,503,456 ACCEPTABLE Seeing the default value: writer had not acted yet.
4294967295 962 FORBIDDEN Other cases are forbidden.
[FAILED] org.sample.ConcurrencyTestNonVolatile
(JVM args: [-XX:TieredStopAtLevel=1])
Observed state Occurrences Expectation Interpretation
-1 152,646,906 ACCEPTABLE Seeing the full value.
-4294967296 42,730 FORBIDDEN Other cases are forbidden.
0 5,638,995 ACCEPTABLE Seeing the default value: writer had not acted yet.
[FAILED] org.sample.ConcurrencyTestNonVolatile
(JVM args: [-Xint])
Observed state Occurrences Expectation Interpretation
-1 10,130,964 ACCEPTABLE Seeing the full value.
-4294967296 15 FORBIDDEN Other cases are forbidden.
0 580,572 ACCEPTABLE Seeing the default value: writer had not acted yet.
[FAILED] org.sample.ConcurrencyTestNonVolatile
(JVM args: [])
Observed state Occurrences Expectation Interpretation
-1 252,283,724 ACCEPTABLE Seeing the full value.
-4294967296 68,771 FORBIDDEN Other cases are forbidden.
0 4,481,182 ACCEPTABLE Seeing the default value: writer had not acted yet.
4294967295 1,264 FORBIDDEN Other cases are forbidden.
*** ERROR tests
Tests break for some reason, other than failing the assert. Correct implementations should have none.
0 matching test results.
*** All remaining tests
Tests that do not fall into any of the previous categories.
4 matching test results.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [-XX:-TieredCompilation])
Observed state Occurrences Expectation Interpretation
-1 1,083,055 ACCEPTABLE Seeing the full value.
0 5,045,006 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [-XX:TieredStopAtLevel=1])
Observed state Occurrences Expectation Interpretation
-1 554,258 ACCEPTABLE Seeing the full value.
0 4,494,923 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [-Xint])
Observed state Occurrences Expectation Interpretation
-1 338,828 ACCEPTABLE Seeing the full value.
0 1,508,643 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [])
Observed state Occurrences Expectation Interpretation
-1 1,906,074 ACCEPTABLE Seeing the full value.
0 9,091,147 ACCEPTABLE Seeing the default value: writer had not acted yet.
RUN COMPLETE.
RUN RESULTS:
------------------------------------------------------------------------------------------------------------------------
*** INTERESTING tests
Some interesting behaviors observed. This is for the plain curiosity.
0 matching test results.
*** FAILED tests
Strong asserts were violated. Correct implementations should have no assert failures here.
0 matching test results.
*** ERROR tests
Tests break for some reason, other than failing the assert. Correct implementations should have none.
0 matching test results.
*** All remaining tests
Tests that do not fall into any of the previous categories.
8 matching test results.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [-XX:-TieredCompilation])
Observed state Occurrences Expectation Interpretation
-1 2,464,426 ACCEPTABLE Seeing the full value.
0 5,641,365 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [-XX:TieredStopAtLevel=1])
Observed state Occurrences Expectation Interpretation
-1 1,936,005 ACCEPTABLE Seeing the full value.
0 4,386,466 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [-Xint])
Observed state Occurrences Expectation Interpretation
-1 331,893 ACCEPTABLE Seeing the full value.
0 936,018 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestAtomicAndVolatile
(JVM args: [])
Observed state Occurrences Expectation Interpretation
-1 3,736,626 ACCEPTABLE Seeing the full value.
0 12,028,515 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestNonVolatile
(JVM args: [-XX:-TieredCompilation])
Observed state Occurrences Expectation Interpretation
-1 199,926,534 ACCEPTABLE Seeing the full value.
0 14,187,297 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestNonVolatile
(JVM args: [-XX:TieredStopAtLevel=1])
Observed state Occurrences Expectation Interpretation
-1 175,765,365 ACCEPTABLE Seeing the full value.
0 11,174,326 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestNonVolatile
(JVM args: [-Xint])
Observed state Occurrences Expectation Interpretation
-1 6,194,295 ACCEPTABLE Seeing the full value.
0 1,430,336 ACCEPTABLE Seeing the default value: writer had not acted yet.
[OK] org.sample.ConcurrencyTestNonVolatile
(JVM args: [])
Observed state Occurrences Expectation Interpretation
-1 168,003,706 ACCEPTABLE Seeing the full value.
0 5,186,625 ACCEPTABLE Seeing the default value: writer had not acted yet.
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.openjdk.jcstress.annotations.*;
import org.openjdk.jcstress.infra.results.J_Result;
@JCStressTest
@Outcome(id = "0", expect = Expect.ACCEPTABLE, desc = "Seeing the default value: writer had not acted yet.")
@Outcome(id = "-1", expect = Expect.ACCEPTABLE, desc = "Seeing the full value.")
@Outcome(expect = Expect.FORBIDDEN, desc = "Other cases are forbidden.")
@State
public class ConcurrencyTestAtomicAndVolatile {
volatile long v;
AtomicLongFieldUpdater<ConcurrencyTestAtomicAndVolatile> updater =
AtomicLongFieldUpdater.newUpdater(ConcurrencyTestAtomicAndVolatile.class, "v");
@Actor
public void writer() {
updater.set(this, -1L); // all 1 bits
}
@Actor
public void reader(J_Result r) {
r.r1 = v;
}
}
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.openjdk.jcstress.annotations.*;
import org.openjdk.jcstress.infra.results.J_Result;
@JCStressTest
@Outcome(id = "0", expect = Expect.ACCEPTABLE, desc = "Seeing the default value: writer had not acted yet.")
@Outcome(id = "-1", expect = Expect.ACCEPTABLE, desc = "Seeing the full value.")
@Outcome(expect = Expect.FORBIDDEN, desc = "Other cases are forbidden.")
@State
public class ConcurrencyTestNonVolatile {
long v;
@Actor
public void writer() {
v = -1L; // all 1 bits
}
@Actor
public void reader(J_Result r) {
r.r1 = v;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment