0001 C R+poonceonces
0002
0003 (*
0004 * Result: Sometimes
0005 *
0006 * This is the unordered (thus lacking smp_mb()) version of one of the
0007 * classic counterintuitive litmus tests that illustrates the effects of
0008 * store propagation delays.
0009 *)
0010
0011 {}
0012
0013 P0(int *x, int *y)
0014 {
0015 WRITE_ONCE(*x, 1);
0016 WRITE_ONCE(*y, 1);
0017 }
0018
0019 P1(int *x, int *y)
0020 {
0021 int r0;
0022
0023 WRITE_ONCE(*y, 2);
0024 r0 = READ_ONCE(*x);
0025 }
0026
0027 exists (y=2 /\ 1:r0=0)