Re: Strange Windows problem, lock_timeout test request

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephen Frost <sfrost@snowman.net>, Boszormenyi Zoltan <zb@cybertec.at>, Hari Babu <haribabu.kommi@huawei.com>, 'Craig Ringer' <craig@2ndQuadrant.com>, 'Hans-Jürgen Schönig' <hs@cybertec.at>, 'Ants Aasma' <ants@cybertec.at>, 'PostgreSQL Hackers' <pgsql-hackers@postgresql.org>, 'Amit kapila' <amit.kapila@huawei.com>
Date: 2013-03-17T00:35:40Z
Lists: pgsql-hackers
Tom Lane wrote:

> Another way that we perhaps should consider is to follow the example of
> XLogInsert and use internally-threaded lists that are typically stored
> in local arrays in the callers.  I've never thought that way was
> especially beautiful, but it does have the advantage of being an idiom
> that's already in use in other low-level code.

FWIW you could use an slist from ilist.c.  It means each node would need
a "next" pointer, but there's no separately allocated list cell.

There are many places that could use slist/dlist.  For instance while
reading the SET PERSISTENT patch I noticed it has head and tail pointers
being passed all over the place, which looks rather ugly.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services