Brooklyn/tools/memory-model/litmus-tests/MP+poonceonces.litmus

28 lines
323 B
Plaintext
Raw Normal View History

2021-05-27 00:09:36 +05:00
C MP+poonceonces
(*
* Result: Sometimes
*
* Can the counter-intuitive message-passing outcome be prevented with
* no ordering at all?
*)
{}
2021-09-23 21:59:15 +05:00
P0(int *x, int *y)
2021-05-27 00:09:36 +05:00
{
2021-09-23 21:59:15 +05:00
WRITE_ONCE(*x, 1);
WRITE_ONCE(*y, 1);
2021-05-27 00:09:36 +05:00
}
2021-09-23 21:59:15 +05:00
P1(int *x, int *y)
2021-05-27 00:09:36 +05:00
{
int r0;
int r1;
2021-09-23 21:59:15 +05:00
r0 = READ_ONCE(*y);
r1 = READ_ONCE(*x);
2021-05-27 00:09:36 +05:00
}
2021-09-23 21:59:15 +05:00
exists (1:r0=1 /\ 1:r1=0)