Re: convert various variables to atomics

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: convert various variables to atomics
Date: 2026-08-04 14:07:58
Message-ID: 207c0bfb-6e06-4358-bb2f-c961915efc36@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23.07.26 21:56, Nathan Bossart wrote:
> On Wed, Jul 22, 2026 at 09:31:49AM -0400, Nathan Bossart wrote:
>> Ah. It looks like we could use 0 as the sentinel and simplify the call
>> sites. They subtract one before calling SetStartupBufferPinWaitBufId() and
>> add one after calling GetStartupBufferPinWaitBufId().
>
> I added a new prerequisite patch (v2-0004) that does this.

Maybe this is okay, but there are a bunch more places (not touched by
your patches) that mix unsigned atomics operations with actually signed
values. Stuff like PIDs and proc numbers. I think for better overall
hygiene and to simplify broader adoption, perhaps we should introduce
support for signed atomic variables.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Rocker 2026-08-04 14:09:30 Re: [PATCH] Fix vacuum_delay_point happening inside lock
Previous Message Alexander Pyhalov 2026-08-04 13:32:22 Re: Asynchronous MergeAppend