Re: fork/exec patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>, "'pgsql-patches(at)postgresql(dot)org'" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fork/exec patch
Date: 2003-12-16 05:06:03
Message-ID: 200312160506.hBG563Z21654@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

Neil Conway wrote:
> + /*
> + * The following need to be available to the read/write_backend_variables
> + * functions
> + */
> + extern XLogRecPtr RedoRecPtr;
> + extern XLogwrtResult LogwrtResult;
> + extern slock_t *ShmemLock;
> + extern slock_t *ShmemIndexLock;
> + extern void *ShmemIndexAlloc;
> + typedef struct LWLock LWLock;
> + extern LWLock *LWLockArray;
> + extern slock_t *ProcStructLock;
> + extern int pgStatSock;
>
> I wonder whether it is cleaner to make these properly public, rather
> than using the NON_EXEC_STATIC #ifdef... (I'm not necessarily saying
> it is, I'm just tossing it out there).

This was my idea. Rather than making statics as globals, they are
global only for exec() builds. This seemed safest. They need to be
extern for exec() because we need to reference them in a function that
writes all the postmaster globals to a file. We could have had a write
function in every C file that needed it and call the write function from
postmaster.c, but that seems like too much bloat. If we make them
extern in all builds we lose the safety of a static.

Your other comments are good and I will wait for Claudio to respond.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-12-16 05:11:04 Re: fork/exec patch
Previous Message Tom Lane 2003-12-16 04:57:40 Re: Oddness 7.3 vs 7.4

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2003-12-16 05:11:04 Re: fork/exec patch
Previous Message Neil Conway 2003-12-16 04:37:40 Re: fork/exec patch

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-12-16 05:11:04 Re: fork/exec patch
Previous Message Neil Conway 2003-12-16 04:37:40 Re: fork/exec patch