Re: dynamically allocating chunks from shared memory

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: dynamically allocating chunks from shared memory
Дата
Msg-id 12332.1281381621@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: dynamically allocating chunks from shared memory  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: dynamically allocating chunks from shared memory  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Aug 9, 2010 at 11:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ... and on some platforms, it'll be flat out impossible. �We looked at
>> this years ago and concluded that changing the size of the shmem segment
>> after postmaster start was impractical from a portability standpoint.
>> I have not seen anything to change that conclusion.

> I haven't done extensive research into this, but I did take a look at
> it briefly.  It looked to me like the style of shared memory we're
> using now (I guess it's System V) has no way to resize a shared memory
> segment at all, and certainly no way that's portable.  However it also
> looked as though POSIX shm (shm_open, etc.) can be resized using
> ftruncate().  Whether this is portable to all the platforms we run on,
> or whether the behavior of ftruncate() in combination with shm_open()
> is in the standard, I'm not sure.

It's not portable.  That's exactly what we were looking into back when.

> I believe I went back and reread
> the old threads on this topic and it seems like the sticking point as
> far as POSIX shm goes it that it lacks a readable equivalent of
> shm_nattch.

Yeah, that was another little problem.  In principle though we only need
one SysV-style shmem segment to get the required interlock, and there
could be add-on shmem segments using POSIX or other APIs.  But that
doesn't get you out from under the portability issue or the memory space
management issue (it's unlikely you can enlarge a segment without
remapping it).
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: dynamically allocating chunks from shared memory
Следующее
От: Tom Lane
Дата:
Сообщение: Re: host name support in pg_hba.conf