LB+poonceonces.litmus 346 B

12345678910111213141516171819202122232425262728
  1. C LB+poonceonces
  2. (*
  3. * Result: Sometimes
  4. *
  5. * Can the counter-intuitive outcome for the load-buffering pattern
  6. * be prevented even with no explicit ordering?
  7. *)
  8. {}
  9. P0(int *x, int *y)
  10. {
  11. int r0;
  12. r0 = READ_ONCE(*x);
  13. WRITE_ONCE(*y, 1);
  14. }
  15. P1(int *x, int *y)
  16. {
  17. int r0;
  18. r0 = READ_ONCE(*y);
  19. WRITE_ONCE(*x, 1);
  20. }
  21. exists (0:r0=1 /\ 1:r0=1)