Re: BeOS and IPC - try 999 - Mailing list pgsql-patches

From Adam Haberlach
Subject Re: BeOS and IPC - try 999
Date
Msg-id 20000614111246.B8368@ricochet.net
Whole thread Raw
In response to Re: BeOS and IPC - try 999  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Wed, Jun 14, 2000 at 12:35:44PM -0400, Tom Lane wrote:
> "David Reid" <david@jetnet.co.uk> writes:
> > OK, agreed (up to a point).  So, you want easier maintenance?  The ONLY
> > way that I can think of doing it is to have the platform specific IPC
> > stuff in it's own file, hence this patch.  The core functions, the ones
> > that have no platform specific code in them, still live in ipc.c but all
> > the functions that are touched by platform code live in either
> > ipc_unix.c or ipc_beos.c.
>
> This is a step forward from what you had, for sure.  I'm not sure if
> the separate-files approach is really good, though, compared to
> a pattern like
>
> int IPCFunction()
> {
> #ifdef BEOS
>     BEOS code
> #else
>     unix code
> #endif
> }
>
> for each function.  The thing that scares me about separate files
> is the out-of-sight, out-of-mind problem: if you make a change
> in one file, will you remember to update the corresponding code
> in the other files (if there is any)?

> Comments anyone?

    Hrm--we already do this sort of thing for the dynaloader
functions, I assume for much the same reason (very different
interfaces on different systems).  It is also somewhat unlikely
that someone modifying the IPC API for one system is going to
be able (or at least willing) to update the functions for other
platforms.  On the other hand, basic IPC hasn't changed much
from semaphore/shared memory for quite a while.

--
Adam Haberlach             |"You have to understand that the
adam@newsnipple.com        |  entire 'Net is based on people with
http://www.newsnipple.com/ |  too much free time on their hands."

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: BeOS and IPC - try 999
Next
From: "Ross J. Reedstrom"
Date:
Subject: filename patch (was Re: [HACKERS] Big 7.1 open items)