Re: cheaper snapshots redux

Поиск
Список
Период
Сортировка
От Markus Wanner
Тема Re: cheaper snapshots redux
Дата
Msg-id 4E54B6AC.3000607@bluegap.ch
обсуждение исходный текст
Ответ на Re: cheaper snapshots redux  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: cheaper snapshots redux  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert, Jim,

thanks for thinking out loud about dynamic allocation of shared memory.Very much appreciated.

On 08/23/2011 01:22 AM, Robert Haas wrote:
> With respect to a general-purpose shared memory allocator, I think
> that there are cases where that would be useful to have, but I don't
> think there are as many of them as many people seem to think.  I
> wouldn't choose to implement this using a general-purpose allocator
> even if we had it, both because it's undesirable to allow this or any
> subsystem to consume an arbitrary amount of memory (nor can it fail...
> especially in the abort path) and because a ring buffer is almost
> certainly faster than a general-purpose allocator.

I'm in respectful disagreement regarding the ring-buffer approach and
think that dynamic allocation can actually be more efficient if done
properly, because there doesn't need to be head and tail pointers, which
might turn into a point of contention.

As a side note: that I've been there with imessages.  Those were first
organized as a ring-bufffer.  The major problem with that approach was
the imessages were consumed with varying delay.  In case an imessage was
left there for a longer amount of time, it blocked creation of new
imessages, because the ring-buffer cycled around once and its head
arrived back at the unconsumed imessage.

IIUC (which might not be the case) the same issue applies for snapshots.

Regards

Markus Wanner


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

Предыдущее
От: Markus Wanner
Дата:
Сообщение: Re: cheaper snapshots redux
Следующее
От: Rushabh Lathia
Дата:
Сообщение: Windows env returns error while running "select pgstatindex"