Re: Atomics in localbuf.c - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Atomics in localbuf.c
Date
Msg-id 37DE0CF6-8920-4BF1-9EF1-6F39E32A65E5@anarazel.de
Whole thread Raw
In response to Atomics in localbuf.c  (Antonin Houska <ah@cybertec.at>)
Responses Re: Atomics in localbuf.c
List pgsql-hackers
Hi

On March 5, 2020 9:21:55 AM PST, Antonin Houska <ah@cybertec.at> wrote:
>What's the reason to use pg_atomic...read_...() and
>pg_atomic...write_...()
>functions in localbuf.c?
>
>It looks like there was an intention not to use them
>
>https://www.postgresql.org/message-id/CAPpHfdtfr3Aj7xJonXaKR8iY2p8uXOQ%2Be4BMpMDAM_5R4OcaDA%40mail.gmail.com
>
>but the following discussion does not explain the decision to use them.

Read/write don't trigger locked/atomic operations. They just guarantee that you're not gonna read/write a torn value.
Ora cached one. Since local/shared buffers share the buffer header definition, we still have to use proper functions to
accessthe atomic variables. 

Regards,

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Next
From: Ibrar Ahmed
Date:
Subject: Re: more ALTER .. DEPENDS ON EXTENSION fixes