Re: pgsql: Add pg_atomic_unlocked_write_u64

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add pg_atomic_unlocked_write_u64
Date: 2025-12-04 18:15:55
Message-ID: 1139398.1764872155@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> How about:

> /*
> * pg_atomic_unlocked_write_u32 - unlocked write to atomic variable.
> *
> * Write to an atomic variable, without atomicity guarantees. I.e. it is not
> * guaranteed that a concurent reader will not see a torn value, nor to

grammar police: s/nor to/nor is this/

> * guaranteed to correctly interact with concurrent read-modify-write
> * operations like pg_atomic_compare_exchange_u32. This should only be used
> * in cases where minor performance regressions due to atomic operations are
> * unacceptable and where exclusive access is guaranteed due to some external
> * means.
> *
> * No barrier semantics.
> */

LGTM otherwise.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2025-12-04 18:41:26 Re: pgsql: Add pg_atomic_unlocked_write_u64
Previous Message Andres Freund 2025-12-04 17:30:28 Re: pgsql: Add pg_atomic_unlocked_write_u64

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-12-04 18:17:58 Re: apply_scanjoin_target_to_paths and partitionwise join
Previous Message Mihail Nikalayeu 2025-12-04 18:02:39 Re: bt_index_parent_check and concurrently build indexes