Re: pg_atomic_exchange_u32() in ProcArrayGroupClearXid() - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: pg_atomic_exchange_u32() in ProcArrayGroupClearXid()
Date
Msg-id CAPpHfdtJ_tYwKiZBQYnwK31nogvXyWzbhAtDpSz586P3vCDN1Q@mail.gmail.com
Whole thread Raw
In response to Re: pg_atomic_exchange_u32() in ProcArrayGroupClearXid()  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Sat, Sep 22, 2018 at 9:55 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
On Fri, Sep 21, 2018 at 11:06 PM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> 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.

Thank you for feedback.  Pushed.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query
Next
From: Tom Lane
Date:
Subject: Re: PATCH: pgbench - option to build using ppoll() for larger connection counts