Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vRDs4-009vvo-1b for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 18:16:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRDs2-0041V3-0F for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 18:16:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vRDs1-0041Uu-2R for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 18:16:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vRDs0-003914-0H for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 18:16:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 5B4IFtQW1139399; Thu, 4 Dec 2025 13:15:55 -0500 From: Tom Lane To: Andres Freund cc: Nathan Bossart , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Add pg_atomic_unlocked_write_u64 In-reply-to: References: <6a7i4g5rroen3jyok4jxpd76tpg7nkicq4o75cdprp5thdlkbn@dfwr7ts43rsm> Comments: In-reply-to Andres Freund message dated "Thu, 04 Dec 2025 12:30:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1139397.1764872155.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 04 Dec 2025 13:15:55 -0500 Message-ID: <1139398.1764872155@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund 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 ext= ernal > * means. > * > * No barrier semantics. > */ LGTM otherwise. regards, tom lane