Shuffling actors
Aleksey Shipilev
shade at redhat.com
Thu Aug 31 14:39:07 UTC 2017
On 08/30/2017 09:24 PM, Sergey Kuksenko wrote:
> That example always shows results:
>
> [OK] org.openjdk.jcstress.samples.CFTest1
> (JVM args: [])
> Observed state Occurrences Expectation Interpretation
> jcstress-worker-1, jcstress-worker-2, jcstress-worker-2 6,960,000 ACCEPTABLE acceptable
> jcstress-worker-2, jcstress-worker-1, jcstress-worker-1 35,544,928 ACCEPTABLE acceptable
>
> (action is always performed in the chain construction thread)
>
> When actor1 & actor2 are interchanged in the source code, I've got:
>
> [OK] org.openjdk.jcstress.samples.CFTest1
> (JVM args: [])
> Observed state Occurrences Expectation Interpretation
> jcstress-worker-1, jcstress-worker-2, jcstress-worker-1 4,888,350 ACCEPTABLE acceptable
> jcstress-worker-2, jcstress-worker-1, jcstress-worker-1 35,843,340 ACCEPTABLE acceptable
> jcstress-worker-2, jcstress-worker-1, jcstress-worker-2 32,768 ACCEPTABLE acceptable
>
> another case was caught - action was performed in the completion thread.
>
> I understand that on another HW/OS/JDK/etc I could get opposite results, therefore shuffling actors
> is important.
I *think* that particular result was pure luck under too few iterations. You have to have more than
5 (default) to capture all juxtapositions.
But anyhow, let's shuffle:
https://bugs.openjdk.java.net/browse/CODETOOLS-7902023
-Aleksey
More information about the jcstress-dev
mailing list