Re: HEADS UP: Win32/OS2/BeOS native ports - Mailing list pgsql-hackers

From Marc G. Fournier
Subject Re: HEADS UP: Win32/OS2/BeOS native ports
Date
Msg-id 20020506113337.V32524-100000@mail1.hub.org
Whole thread Raw
In response to Re: HEADS UP: Win32/OS2/BeOS native ports  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: HEADS UP: Win32/OS2/BeOS native ports  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 6 May 2002, Tom Lane wrote:

> I said:
> > 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?
>
> Oh, I take that back, I see how you could do it: the postmaster opens
> the socket *for writing*, but never actually writes.  All its child
> processes inherit that same open file descriptor and just keep it
> around.  Then, to tell if anyone's home, you open the socket *for
> reading* and try to read in O_NONBLOCK mode.  You get an EOF indication
> if and only if no one has the socket open for writing; otherwise you
> get an EAGAIN error.
>
> That would work ... but is it more portable than depending on SysV
> shmem connection counts?  ISTR that some of the platforms we support
> don't have Unix-style sockets at all.

Wouldn't the same thing work with a simple file?  Does it have to be a
UnixDomainSocket?




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: HEADS UP: Win32/OS2/BeOS native ports
Next
From: Tom Lane
Date:
Subject: Re: HEADS UP: Win32/OS2/BeOS native ports