Re: fork() refactoring

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fork() refactoring
Дата
Msg-id 17388.1110038066@sss.pgh.pa.us
обсуждение исходный текст
Ответ на fork() refactoring  (Neil Conway <neilc@samurai.com>)
Ответы Re: fork() refactoring
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> This patch moves all the common code that is usually invoked before
> doing a fork() into a single function, fork_process(). It is not aware
> of the EXEC_BACKEND machinery, so it should be used as fork() currently
> is -- inside an #ifndef EXEC_BACKEND block, if appropriate.

I'm worried about whether this doesn't break the EXEC_BACKEND case.
Most of the code you've moved out isn't applicable to Windows, but
the fflushes probably are --- and they are certainly applicable when
testing EXEC_BACKEND mode on a Unix machine, which is a case you may
*not* break because it will render Windows completely unsupportable.

> Barring any objections, I'll apply this to HEAD on Monday.

Please do not apply without some further portability testing.

I think it would be better to continue with your original thought of
passing a token into this code so that the EXEC_BACKEND case could be
handled too (the token would tell it which forkexec function to call).
That would probably mean that the function has to stay within
postmaster.c, but as long as it consolidates the N cases of fork
decoration into one, we're still ahead of the game.

            regards, tom lane

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

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: Display Pg buffer cache (WIP)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Display Pg buffer cache (WIP)