Re: Xlogprefetcher: Use atomic add for increment counter - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Xlogprefetcher: Use atomic add for increment counter
Date
Msg-id CAEudQAoRHCYV5No6qNEUbrR-JCGakaB0xjN7BcXtv++dXyBD7w@mail.gmail.com
Whole thread Raw
In response to Re: Xlogprefetcher: Use atomic add for increment counter  (Andres Freund <andres@anarazel.de>)
Responses Re: Xlogprefetcher: Use atomic add for increment counter
List pgsql-hackers

Em sex., 7 de nov. de 2025 às 11:41, Andres Freund <andres@anarazel.de> escreveu:
Hi,

On 2025-11-07 11:28:06 -0300, Ranier Vilela wrote:
> Use pg_atomic_fetch_add_u64 to replace pg_atomic_read_u64 and
> pg_atomic_write_u64 calls.
>
> This simplifies the logic and this increases the likelihood that the
> operation will be successful.

How does it do so? As the assertions indicate, this can only be run from a
single process.
Can I rephrase that?

That simplifies the logic a bit.

best regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences
Next
From: Andres Freund
Date:
Subject: Re: Xlogprefetcher: Use atomic add for increment counter