IRIW+poonceonces+OnceOnce.litmus 655 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. C IRIW+poonceonces+OnceOnce
  2. (*
  3. * Result: Sometimes
  4. *
  5. * Test of independent reads from independent writes with nothing
  6. * between each pairs of reads. In other words, is anything at all
  7. * needed to cause two different reading processes to agree on the order
  8. * of a pair of writes, where each write is to a different variable by a
  9. * different process?
  10. *)
  11. {}
  12. P0(int *x)
  13. {
  14. WRITE_ONCE(*x, 1);
  15. }
  16. P1(int *x, int *y)
  17. {
  18. int r0;
  19. int r1;
  20. r0 = READ_ONCE(*x);
  21. r1 = READ_ONCE(*y);
  22. }
  23. P2(int *y)
  24. {
  25. WRITE_ONCE(*y, 1);
  26. }
  27. P3(int *x, int *y)
  28. {
  29. int r0;
  30. int r1;
  31. r0 = READ_ONCE(*y);
  32. r1 = READ_ONCE(*x);
  33. }
  34. exists (1:r0=1 /\ 1:r1=0 /\ 3:r0=1 /\ 3:r1=0)