Re: BUFFER_LOCK_EXCLUSIVE is used in ginbuildempty().

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pg(at)heroku(dot)com, alvherre(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: BUFFER_LOCK_EXCLUSIVE is used in ginbuildempty().
Date: 2014-07-22 10:03:03
Message-ID: 20140722.190303.225303886.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

At Thu, 17 Jul 2014 15:54:31 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in <10710(dot)1405626871(at)sss(dot)pgh(dot)pa(dot)us>
> Peter Geoghegan <pg(at)heroku(dot)com> writes:
> > On Thu, Jul 17, 2014 at 7:47 AM, Alvaro Herrera
> > <alvherre(at)2ndquadrant(dot)com> wrote:
> >> I don't understand the point of having these GIN_EXCLUSIVE / GIN_SHARED
> >> symbols. It's not like we could do anything different than
> >> BUFFER_LOCK_EXCLUSIVE etc instead. It there was a GinLockBuffer() it
> >> might make more sense to have specialized symbols, but as it is it seems
> >> pointless.

I agree with you. From the eyes not specialized for each AM, of
me, the translation-only symbols didn't make me so happy.

> > It's a pattern common to the index AMs. I think it's kind of pointless
> > myself, but as long as we're doing it we might as well be consistent.
>
> I think that to the extent that these symbols are used in APIs above the
> direct buffer-access layer, they are useful --- for example using
> BT_READ/BT_WRITE in _bt_search calls seems like a useful increment of
> readability. GIN seems to have less of that than some of the other AMs,
> but I do see GIN_SHARE being used that way in some calls.
>
> BTW, there's one direct usage of BUFFER_LOCK_EXCLUSIVE in the GIST code
> as well, which should probably be replaced with GIST_EXCLUSIVE if we're
> trying to be consistent.

Though I brought up this topic, this kind of consistency seems
not needed so much. If so, it seems better to be left as it is.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message 土卜皿 2014-07-22 10:13:13 Re: how to reach D5 in tuplesort.c 's polyphase merge algorithm?
Previous Message Kyotaro HORIGUCHI 2014-07-22 09:38:12 Re: WAL replay bugs