Re: Xlogprefetcher: Use atomic add for increment counter

From: Andres Freund <andres(at)anarazel(dot)de>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Xlogprefetcher: Use atomic add for increment counter
Date: 2025-11-07 14:41:05
Message-ID: llqqqxwalc3p7manuoehxsgosegtxzmjnqarghp36jiy7rdgdn@gurddwvx46o6
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marcos Pegoraro 2025-11-07 14:47:36 Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement
Previous Message Ranier Vilela 2025-11-07 14:28:06 Xlogprefetcher: Use atomic add for increment counter