From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Add pg_atomic_unlocked_write_u64
Date: Thu, 4 Dec 2025 10:03:22 -0600
Message-ID: <aTGwysvF2lDmK2lP@nathan> (raw)
In-Reply-To: <6a7i4g5rroen3jyok4jxpd76tpg7nkicq4o75cdprp5thdlkbn@dfwr7ts43rsm>
References: <E1vQwSk-002fZh-2h@gemulon.postgresql.org>
<aTGt7q4Jvn97uGAx@nathan>
<6a7i4g5rroen3jyok4jxpd76tpg7nkicq4o75cdprp5thdlkbn@dfwr7ts43rsm>
On Thu, Dec 04, 2025 at 10:56:12AM -0500, Andres Freund wrote:
> The whole point of the _unlocked_ function is to use it for modifying an
> atomic that doesn't need to actually be atomic when modified by that
> function. The current use-case for it is to to modify BufferDesc->state for
> temporary table buffers. Those obviously can't be shared across processes and
> therefore don't need an atomic operation to be modified. In the referenced
> thread I'm working on converting BufferDesc->state to be a 64bit atomic, hence
> the need for pg_atomic_unlocked_write_u64().
>
> I didn't notice that the comment for pg_atomic_unlocked_write_u32() makes that
> claim about partial writes not being visible. I think we should just remove
> that claim.
+1 to updating the comment with this context.
--
nathan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: nathandbossart@gmail.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Add pg_atomic_unlocked_write_u64
In-Reply-To: <aTGwysvF2lDmK2lP@nathan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox