MP+pooncerelease+poacquireonce.litmus 401 B

12345678910111213141516171819202122232425262728
  1. C MP+pooncerelease+poacquireonce
  2. (*
  3. * Result: Never
  4. *
  5. * This litmus test demonstrates that smp_store_release() and
  6. * smp_load_acquire() provide sufficient ordering for the message-passing
  7. * pattern.
  8. *)
  9. {}
  10. P0(int *x, int *y)
  11. {
  12. WRITE_ONCE(*x, 1);
  13. smp_store_release(y, 1);
  14. }
  15. P1(int *x, int *y)
  16. {
  17. int r0;
  18. int r1;
  19. r0 = smp_load_acquire(y);
  20. r1 = READ_ONCE(*x);
  21. }
  22. exists (1:r0=1 /\ 1:r1=0)