Re: Win32 semaphore patch

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: Win32 semaphore patch
Дата
Msg-id e29hb3$1kd1$1@news.hub.org
обсуждение исходный текст
Ответ на Re: Win32 semaphore patch  ("Magnus Hagander" <mha@sollentuna.net>)
Ответы Re: Win32 semaphore patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
""Magnus Hagander"" <mha@sollentuna.net> wrote
> >
> > 1. Backend crash while postmaster stays alive: postmaster
> > will get to execute the on_shmem_exit() callback after all
> > the backends are gone, and that can clean 'em up.
> >
> > 2. postmaster crashes: we'd like the semas to go away
> > automatically when the last backend goes away.  If this
> > doesn't happen, then there has to be logic to recycle
> > leftover semas when the postmaster is next started.
> >
> > Most of the ugliness in sysv_sema.c is because it has to do "manual"
> > cleanup per #2.
> >
>
> For #2, yes, the semaphores will go away when the last process holding a
> HANDLE to it goes away. For #1, the code seems to handle that right?
>

I intentionally use *unnamed* semaphores to avoid these problems -- even if
the semaphores didn't go away (as Magus pointed out, if all processes can
exit gracefully, this won't happen), we won't worry about them -- Creating
semahpores will still succeed because there is no existent same named
semaphores will bother it.

Regards,
Qingqing



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Win32 semaphore patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Win32 semaphore patch