Re: pg_atomic_exchange_u32() in ProcArrayGroupClearXid()

2018-09-22 Thread Alexander Korotkov
On Sat, Sep 22, 2018 at 9:55 AM Amit Kapila wrote: > On Fri, Sep 21, 2018 at 11:06 PM Alexander Korotkov > 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 instea

Re: pg_atomic_exchange_u32() in ProcArrayGroupClearXid()

2018-09-21 Thread Amit Kapila
On Fri, Sep 21, 2018 at 11:06 PM Alexander Korotkov 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_e

pg_atomic_exchange_u32() in ProcArrayGroupClearXid()

2018-09-21 Thread Alexander Korotkov
Hi! While investigating ProcArrayGroupClearXid() code I wonder why do we have this loop instead of plain pg_atomic_exchange_u32() call? Is it intentional? /* * Now that we've got the lock, clear the list of processes waiting for * group XID clearing, saving a pointer to the head of the list. Tr