Re: locked reads for atomics

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: locked reads for atomics
Date: 2024-02-23 19:32:47
Message-ID: 20240223193247.GA1698856@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-02-23 20:58:12 Re: locked reads for atomics
Previous Message Jeff Davis 2024-02-23 18:25:00 Re: locked reads for atomics