RFR: 7902982: jcstress: Add samples for some mutex algorithms [v3]

Vladimir Sitnikov vsitnikov at openjdk.java.net
Tue Jun 29 14:31:15 UTC 2021


On Tue, 29 Jun 2021 14:22:08 GMT, Michael Mirwaldt <github.com+6693355+mmirwaldt at openjdk.org> wrote:

>> Yes, you are right. I must confess that I had to think about 30min why Aleksey's solution work. His solution is clever.
>> Then I tried to explain it in comments but I failed. I will try it again.
>
> I have added a comment now to Mutex_01_NoAlgorithm . I hope users understand my explaination.
> If you like to change something in my explaination, just tell me.

I am afraid Alexey suggests `r.r1 = ++v;` pattern that is indeed easier to read (less 1-2 in variable names), and it is easier to reason about at the same time: the outcome becomes "the order of actors in the critical section".

-------------

PR: https://git.openjdk.java.net/jcstress/pull/85


More information about the jcstress-dev mailing list