Re: fork/exec patch

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: fork/exec patch
Дата
Msg-id 200312160506.hBG563Z21654@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: fork/exec patch  (Neil Conway <neilc@samurai.com>)
Список 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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-patches по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: fork/exec patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: fork/exec patch