-
-
Save yohhoy/14b88ad316aac1445da7ce515f989812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://groups.google.com/g/golang-nuts/c/Gze1TRtdLdc/m/RoD2AxssDgAJ | |
// http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ | |
int main() { | |
int x = 0; | |
atomic_int int y = 0; | |
{{{ { x = 1; | |
y.store(1); | |
x = 1; | |
y.store(1); } | |
||| { y.load().readsvalue(0); | |
y.load().readsvalue(1); | |
r1 = x; } | |
}}}; | |
return 0; } | |
// 864 executions; 2 consistent, only 1 race free |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment