LB+poacquireonce+pooncerelease.litmus 412 B

1234567891011121314151617181920212223242526272829
  1. C LB+poacquireonce+pooncerelease
  2. (*
  3. * Result: Never
  4. *
  5. * Does a release-acquire pair suffice for the load-buffering litmus
  6. * test, where each process reads from one of two variables then writes
  7. * to the other?
  8. *)
  9. {}
  10. P0(int *x, int *y)
  11. {
  12. int r0;
  13. r0 = READ_ONCE(*x);
  14. smp_store_release(y, 1);
  15. }
  16. P1(int *x, int *y)
  17. {
  18. int r0;
  19. r0 = smp_load_acquire(y);
  20. WRITE_ONCE(*x, 1);
  21. }
  22. exists (0:r0=1 /\ 1:r0=1)