Xlogprefetcher: Use atomic add for increment counter

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Xlogprefetcher: Use atomic add for increment counter
Date: 2025-11-07 14:28:06
Message-ID: CAEudQAoWRScRVqygSfuQmCN=CKQhHXVH_nD=GPQw0sO+UwXz4Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

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.

patch attached.

best regards,
Ranier Vilela

Attachment Content-Type Size
use-atomic-add-for-increment-counter.patch application/octet-stream 496 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-11-07 14:41:05 Re: Xlogprefetcher: Use atomic add for increment counter
Previous Message Akshay Joshi 2025-11-07 14:27:06 Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement