Re: fork/exec

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fork/exec
Дата
Msg-id 24103.1070213411@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: fork/exec  (Claudio Natoli <claudio.natoli@memetrics.com>)
Список pgsql-hackers-win32
Claudio Natoli <claudio.natoli@memetrics.com> writes:
> Would it be possible to re-jig ShmemInitStruct to not require locking

That strikes me as entirely unsafe.

Back when we actually had fork/exec for Unix, there were three shmem
segments not one.  Part of the reason for this was that spinlocks
occupied their own segment, and so they could be found and accessed
without any reference to the main shmem index.  (I forget what the
third segment was for, but I think it was not critical for startup.)

Probably the best way to model this now is to put a pointer (or whatever
is needed) to the LWLock array into the shmem segment header, whence
it can be grabbed without any locking.  This will allow a new backend's
lock manager to be initialized immediately.  Then we can safely (ie,
with locking) initialize access to the shmem index hashtable (it might
take another pointer in the segment header to find it) and then
everything else can be looked up in the index hashtable.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: fork/exec
Следующее
От: Claudio Natoli
Дата:
Сообщение: Re: fork/exec