Re: Optimize LISTEN/NOTIFY - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: Optimize LISTEN/NOTIFY
Date
Msg-id a0215c3a-ffd0-41f1-900c-ddc74e1ffd6d@app.fastmail.com
Whole thread Raw
In response to Re: Optimize LISTEN/NOTIFY  (Arseniy Mukhin <arseniy.mukhin.dev@gmail.com>)
Responses Re: Optimize LISTEN/NOTIFY
List pgsql-hackers
On Thu, Nov 13, 2025, at 07:36, Arseniy Mukhin wrote:
> On Thu, Nov 13, 2025 at 9:28 AM Joel Jacobson <joel@compiler.org> wrote:
>> I think this confirms that listeners can actually stop somewhere in between
>> queueHeadBeforeWrite and queueHeadAfterWrite.
>
>
> Ahh, yes, I think you are right. I missed that notifiers update the
> head when they move to the next page. Thank you for the detailed
> example and sorry for taking your time with it. I agree that
> QUEUE_POS_PRECEDES(pos, queueHeadAfterWrite) is correct and covers
> more cases where we can do direct advancement.

Thanks for investigating this; we now both have an even stronger mental
model of the code.

Attached, please find a new version rebased on top of the bug fix
patches that just got committed in 0bdc777, 797e9ea, 8eeb4a0, and
1b46990.

/Joel
Attachment

pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Re: Suggestion to add --continue-client-on-abort option to pgbench
Next
From: Corey Huinker
Date:
Subject: Re: Extended Statistics set/restore/clear functions.