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

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, Matthew Kirkwood <matthew(at)hairy(dot)beasts(dot)org>, Igor Kovalenko <Igor(dot)Kovalenko(at)motorola(dot)com>, mlw <markw(at)mohawksoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: HEADS UP: Win32/OS2/BeOS native ports
Date: 2002-05-06 18:34:41
Message-ID: 200205061834.g46IYf417810@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

I think what you describe is a named pipe, not a socket. The
underlying implementation might be a socketpair, but the
behaviour of named pipes is exactly that since Version 7 at
least. This worked under Minix already.

>
> regards, tom lane

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nigel J. Andrews 2002-05-06 19:12:52 Re: Schemas: status report, call for developers
Previous Message Ryan Bradetich 2002-05-06 17:52:00 a couple of minor itches: RI Trigger Names, and additional Alter ownerships commands.