On Fri, 2024-02-23 at 10:17 -0600, Nathan Bossart wrote:
> The idea is
> to provide an easy way to remove spinlocks, etc. and use atomics for
> less
> performance-sensitive stuff.  The implementations are intended to be
> relatively inexpensive and might continue to improve in the future,
> but the
> functions are primarily meant to help reason about correctness.

To be clear:

  x = pg_atomic_[read|write]_membarrier_u64(&v);

is semantically equivalent to:

  pg_memory_barrier();
  x = pg_atomic_[read|write]_u64(&v);
  pg_memory_barrier();

?

If so, that does seem more convenient.

Regards,
        Jeff Davis


Reply via email to