Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Дата
Msg-id 24612.1460991515@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-committers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Apr 18, 2016 at 10:27 AM, Andres Freund <andres@anarazel.de> wrote:
>> Personally I think the "spin" part is actually quite relevant, and I
>> think we shouldn't loose it. It describes concurrency and blocking
>> behaviour, and how errors need to be handled (i.e. there may not be
>> any).

> IMHO, "buffer header lock bit" is plenty clear enough.  We could say
> "buffer header spin lock bit" but I think that's too many words and
> not actually more clear.

I agree.  If it's just a bit, it pretty much has to be a spin lock,
because there's no way for it to contain any infrastructure that would
support anything else.  In any case, you could and should document the
exact semantics in a comment associated with the declaration of that
bit field.  It's not really necessary to repeat them in every reference,
so long as the references use a unique name that won't be confused with
other possible locking mechanisms.  (From that standpoint, "header lock
bit" might be actively better than anything including the phrase "spin
lock", since it reduces the chance of confusion with s_lock.h.)

            regards, tom lane


В списке pgsql-committers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix --disable-spinlocks in 9.2 and 9.3 branches.