Re: Atomics in localbuf.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Atomics in localbuf.c
Date: 2020-03-06 16:26:41
Message-ID: CA+TgmoaiUy_eHhG9fhA_Men28Y1Es-HbKSXbmrCHCQYh-ribBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 6, 2020 at 2:04 AM Antonin Houska <ah(at)cybertec(dot)at> 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.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-03-06 16:46:16 Re: Crash by targetted recovery
Previous Message Jeremy Finzel 2020-03-06 15:47:49 Re: PHJ file leak.