Re: pg_atomic_exchange_u32() in ProcArrayGroupClearXid()

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_atomic_exchange_u32() in ProcArrayGroupClearXid()
Date: 2018-09-22 06:55:09
Message-ID: CAA4eK1+OObaLgGGDnbwFR3S6oFgvAw9XvN2YZ8uFXQ7KzR7T4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 21, 2018 at 11:06 PM Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
>
> Hi!
>
> While investigating ProcArrayGroupClearXid() code I wonder why do we have this loop instead of plain pg_atomic_exchange_u32() call?
>

We can use pg_atomic_exchange_u32 instead of a loop. In fact, clog
code uses pg_atomic_exchange_u32 for the same purpose. I think it is
better to make the code consistent at both places. Feel free to
change it, otherwise, I can take care of it in a few days time.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2018-09-22 07:02:25 Re: Proposal for disk quota feature
Previous Message Edmund Horner 2018-09-22 06:53:55 Re: PATCH: psql tab completion for SELECT