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

From Tom Lane
Subject Re: BeOS and IPC - try 999
Date
Msg-id 14983.961000544@sss.pgh.pa.us
Whole thread Raw
In response to BeOS and IPC - try 999  ("David Reid" <david@jetnet.co.uk>)
Responses Re: BeOS and IPC - try 999  (Adam Haberlach <adam@newsnipple.com>)
List pgsql-patches
"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)?

OTOH the code for each platform is certainly cleaner this way.

Comments anyone?

            regards, tom lane

pgsql-patches by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: BeOS and IPC - try 999
Next
From: Adam Haberlach
Date:
Subject: Re: BeOS and IPC - try 999