Re: LWLock/ShmemIndex startup question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: LWLock/ShmemIndex startup question
Дата
Msg-id 11176.1074005663@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: LWLock/ShmemIndex startup question  (Claudio Natoli <claudio.natoli@memetrics.com>)
Список pgsql-hackers
Claudio Natoli <claudio.natoli@memetrics.com> writes:
> FWIW, I've done a code walk-through, and it looks ok (lack of real-world
> testing notwithstanding), and actually does use the Win32 sema set. The only
> real problem is that it calls ShmemInitStruct in semget, which ultimately
> gets us into bootstrap hell (without native spinlocks, at least).

Right.  The advantage of the pg_sema.h API is that you don't need any
shared control data.  Take a close look at the way posix_sema works:
the management information needed to release the semas at shutdown is
private to the postmaster.  What is in shared memory need only be a
reference or token (whatever you have to hand to the lock/unlock calls).
Also, allocation of the shmem space is not the responsibility of the
startup routine.  So all these issues go away as long as you're not
trying to emulate the SysV interface.
        regards, tom lane


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

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: [pgsql-hackers-win32] Win32 signal code - first try
Следующее
От: Tom Lane
Дата:
Сообщение: Re: LWLock/ShmemIndex startup question