Re: Replace PROC_QUEUE / SHM_QUEUE with ilist.h

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org
Cc: Robert Haas <robertmhaas@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Amit Langote <amitlangote09@gmail.com>
Date: 2023-01-20T02:58:45Z
Lists: pgsql-hackers
Hi,

On 2022-12-03 10:17:22 -0800, Andres Freund wrote:
> On 2022-11-19 21:59:30 -0800, Andres Freund wrote:
> > In [1] Robert justifiably complained about the use of PROC_QUEUE. I've
> > previously been bothered by this in [2], but didn't get around to finishing
> > the patches.
> > 
> > One thing that made me hesitate was the naming of the function for a) checking
> > whether a dlist_node is a list, b) initializing and deleting nodes in a way to
> > allow for a).  My patch adds dlist_node_init(), dlist_delete_thoroughly() /
> > dlist_delete_from_thoroughly() / dclist_delete_from_thoroughly() and
> > dlist_node_is_detached().  Thomas proposed dlist_delete_and_reinit() and
> > dlist_node_is_linked() instead.
> 
> Any comments on these names? Otherwise I'm planning to push ahead with the
> names as is, lest I forget this patchset for another ~2 years.

Finally pushed, with some fairly minor additional cleanup. No more SHM_QUEUE,
yay!

Also, predicate.c really needs some love.

Greetings,

Andres Freund



Commits

  1. Remove SHM_QUEUE

  2. Use dlists instead of SHM_QUEUE for predicate locking

  3. Use dlists instead of SHM_QUEUE for syncrep queue

  4. Add detached node functions to ilist

  5. Use dlist/dclist instead of PROC_QUEUE / SHM_QUEUE for heavyweight locks