Re: EXEC_BACKEND

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXEC_BACKEND
Date: 2008-09-23 20:43:12
Message-ID: 200809232043.m8NKhCQ10407@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:
> Bruce Momjian wrote:
> > Simon Riggs wrote:
> >> On Tue, 2008-09-16 at 15:53 -0400, Tom Lane wrote:
> >>> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> >>>> We keep talking about EXEC_BACKEND mode, though until recently I had
> >>>> misunderstood what that meant. I also realised that I have more than
> >>>> once neglected to take it into account when writing a patch - one recent
> >>>> patch failed to do this.
> >>>> I can't find anything coherent in docs/readme/comments to explain why it
> >>>> exists and what its implications are.
> >>> It exists because Windows doesn't have fork(), only the equivalent of
> >>> fork-and-exec. Which means that no state variables will be inherited
> >>> from the postmaster by its child processes, and any state that needs to
> >>> be carried across has to be handled explicitly. You can define
> >>> EXEC_BACKEND in a non-Windows build, for the purpose of testing code
> >>> to see if it works in that environment.
> >> OK, if its that simple then I see why its not documented. Thanks. I
> >> thought there might be more to it than that.
> >
> > I added a little documentation at the top of
> > postmaster.c::backend_forkexec().
>
> Doesn't that make more sense in say, the Developer FAQ?

I figured I should put it where it is used; the developer's FAQ is for
more generalized issues, I feel.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-09-23 20:50:43 Re: parallel pg_restore
Previous Message Magnus Hagander 2008-09-23 20:40:23 Re: EXEC_BACKEND