Re: Readme of Buffer Management seems to have wrong sentence

From: Ants Aasma <ants(at)cybertec(dot)at>
To: Ants Aasma <ants(at)cybertec(dot)at>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila(at)huawei(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Readme of Buffer Management seems to have wrong sentence
Date: 2012-05-24 22:38:39
Message-ID: CA+CSw_tYwZ=N1kg46VhDKHMHT47X9W4sRumVDJQNo_wGRfVNpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 22, 2012 at 11:36 PM, Ants Aasma <ants(at)cybertec(dot)at> wrote:
> ... The free list
> itself is a bit trickier, but if it's still necessary/useful then
> SC->firstFreeBuffer and buf->freeNext are in effect a linked-list
> stack, there should plenty of tested lock free algorithms floating
> around for that. (btw. lastFreeBuffer looks like dead code, is that
> correct?)

Thinking about it a bit more, if the freelist is mostly empty, a
simpler alternative would be to make an unprotected read to check
SC->firstFreeBuffer and only acquire BufFreelistLock if there's
anything to pop. This would reduce the lock free parts to just
atomically incrementing a variable.

Ants Aasma
--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2012-05-24 23:06:40 Re: [RFC] Interface of Row Level Security
Previous Message Sergey Koposov 2012-05-24 22:36:03 Re: 9.2beta1, parallel queries, ReleasePredicateLocks, CheckForSerializableConflictIn in the oprofile