Paul E. McKenney | 1c27b64 | 2018-01-18 19:58:55 -0800 | [diff] [blame] | 1 | C R+poonceonces |
2 | |||||
Paul E. McKenney | 8f32543 | 2018-02-20 15:25:04 -0800 | [diff] [blame] | 3 | (* |
4 | * Result: Sometimes | ||||
5 | * | ||||
6 | * This is the unordered (thus lacking smp_mb()) version of one of the | ||||
7 | * classic counterintuitive litmus tests that illustrates the effects of | ||||
8 | * store propagation delays. | ||||
9 | *) | ||||
10 | |||||
Paul E. McKenney | 1c27b64 | 2018-01-18 19:58:55 -0800 | [diff] [blame] | 11 | {} |
12 | |||||
13 | P0(int *x, int *y) | ||||
14 | { | ||||
15 | WRITE_ONCE(*x, 1); | ||||
16 | WRITE_ONCE(*y, 1); | ||||
17 | } | ||||
18 | |||||
19 | P1(int *x, int *y) | ||||
20 | { | ||||
21 | int r0; | ||||
22 | |||||
23 | WRITE_ONCE(*y, 2); | ||||
24 | r0 = READ_ONCE(*x); | ||||
25 | } | ||||
26 | |||||
27 | exists (y=2 /\ 1:r0=0) |