Re: Atomics in localbuf.c

Поиск
Список
Период
Сортировка
Искать
От
Andres Freund
Тема
Re: Atomics in localbuf.c
Дата
Msg-id
20200306190641.ak432cz2vbhurtvy@alap3.anarazel.de
Ответ на
Список
Дерево обсуждения
Atomics in localbuf.c Antonin Houska <ah@cybertec.at>
Re: Atomics in localbuf.c Andres Freund <andres@anarazel.de>
Re: Atomics in localbuf.c Antonin Houska <ah@cybertec.at>
Re: Atomics in localbuf.c Andres Freund <andres@anarazel.de>
Re: Atomics in localbuf.c Antonin Houska <ah@cybertec.at>
Re: Atomics in localbuf.c Robert Haas <robertmhaas@gmail.com>
Re: Atomics in localbuf.c Andres Freund <andres@anarazel.de>
Re: Atomics in localbuf.c Robert Haas <robertmhaas@gmail.com>
Hi,

On 2020-03-06 11:26:41 -0500, Robert Haas wrote:
> On Fri, Mar 6, 2020 at 2:04 AM Antonin Houska  wrote:
> > ok. What I missed is that BufferDesc.state is declared as pg_atomic_uint32
> > rather than plain int, so the pg_atomic_...() functions should be used
> > regardless the buffer is shared or local. Sorry for the noise.
>
> Right. I thought, though, that your question was why we did it that
> way instead of just declaring them as uint32. I'm not sure it's very
> important, but I think that question hasn't really been answered.

I tried, at least:

> Since local/shared buffers share the buffer header definition, we still have to use proper functions to access
> the atomic variables.

There's only one struct BufferDesc. We could separate them out /
introduce a union or such. But that'd add some complexity / potential
for mistakes too.

Greetings,

Andres Freund


В списке pgsql-hackers по дате отправления
От: Peter Geoghegan
Дата:
От: Aleksei Ivanov
Дата:
FAQ