Re: locked reads for atomics - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: locked reads for atomics
Date
Msg-id 20240223193247.GA1698856@nathanxps13
Whole thread Raw
In response to Re: locked reads for atomics  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: locked reads for atomics
List pgsql-hackers
On Fri, Feb 23, 2024 at 10:25:00AM -0800, Jeff Davis wrote:
> 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.

I think that's about right.  The upthread feedback from Andres [0] provides
some additional context.

[0] https://postgr.es/m/20231110231150.fjm77gup2i7xu6hc%40alap3.anarazel.de

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: locked reads for atomics
Next
From: Nathan Bossart
Date:
Subject: Re: locked reads for atomics