Re: HEADS UP: Win32/OS2/BeOS native ports

Поиск
Список
Период
Сортировка
От Matthew Kirkwood
Тема Re: HEADS UP: Win32/OS2/BeOS native ports
Дата
Msg-id Pine.LNX.4.33.0205071204590.4713-100000@sphinx.mythic-beasts.com
обсуждение исходный текст
Ответ на Re: HEADS UP: Win32/OS2/BeOS native ports  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: HEADS UP: Win32/OS2/BeOS native ports  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, 6 May 2002, Tom Lane wrote:

> > As a backend is started up, connect to that socket ... if socket is open
> > when trying to start a new frontend, fail as there are currently other
> > connections attached to it?
>
> But the backends would only have the socket open, they'd not be
> actively listening to it.  So how could you tell whether anyone
> had the socket open or not?

It's easy.  As startup, the postmaster (or standalone
backend) creates a Unix socket, binds it to the filename
and calls listen on it.

If another backend is running, it'll get EADDRINUSE from
the bind or listen.

Nobody actually needs to connect to the socket.  Simple,
race-free, 10 lines of code.

Matthew.



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

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Schemas: status report, call for developers
Следующее
От:
Дата:
Сообщение: Re: STILL LACKING: CVS tag for release 7.2.1