SB+poonceonces.litmus 423 B

1234567891011121314151617181920212223242526272829
  1. C SB+poonceonces
  2. (*
  3. * Result: Sometimes
  4. *
  5. * This litmus test demonstrates that at least some ordering is required
  6. * to order the store-buffering pattern, where each process writes to the
  7. * variable that the preceding process reads.
  8. *)
  9. {}
  10. P0(int *x, int *y)
  11. {
  12. int r0;
  13. WRITE_ONCE(*x, 1);
  14. r0 = READ_ONCE(*y);
  15. }
  16. P1(int *x, int *y)
  17. {
  18. int r0;
  19. WRITE_ONCE(*y, 1);
  20. r0 = READ_ONCE(*x);
  21. }
  22. exists (0:r0=0 /\ 1:r0=0)