Re: Throwing away unnecessary spin-locks - Mailing list pgsql-hackers

From Alexandre Felipe
Subject Re: Throwing away unnecessary spin-locks
Date
Msg-id CAE8JnxOQjWEkOyW8ZaZNUDtQ5ixa823U6h_C47UazX03aUVHkQ@mail.gmail.com
Whole thread
In response to Re: Throwing away unnecessary spin-locks  (Alexandre Felipe <o.alexandre.felipe@gmail.com>)
Responses Re: Throwing away unnecessary spin-locks
List pgsql-hackers
Hi Shihao,

On Fri, Oct 2, 2026 at 6:30 AM shihao zhong <zhong950419@gmail.com> wrote:

I think the safer route is what recent commits like df3978c2340 did,
convert the field to pg_atomic and use pg_atomic_read_membarrier_u32()
and pg_atomic_write_membarrier_u32().

Actually, v1 conflicted with that commit, rebasing.

The reason I didn't want to do that is that I wanted a uniform way to handle
all types.

v1.1 pg_atomic_{write,read}_membarrier_uint{32,64} and keeps the 
lock for 8- and 16-bits.

Can we use pg_atomic_flag for bool, or will that have different representations?


Regards,
Alexandre felipe
Attachment

pgsql-hackers by date:

Previous
From: Ayush Tiwari
Date:
Subject: Re: PANIC serves too many masters
Next
From: Andres Freund
Date:
Subject: Re: Throwing away unnecessary spin-locks