Re: fork/exec - Mailing list pgsql-hackers-win32

From Bruce Momjian
Subject Re: fork/exec
Date
Msg-id 200311281948.hASJmpG11966@candle.pha.pa.us
Whole thread Raw
In response to Re: fork/exec  (Claudio Natoli <claudio.natoli@memetrics.com>)
Responses Re: fork/exec  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers-win32
Claudio Natoli wrote:
> * With regards to BackendFork itself, was your plan to reduce this to simply
> formatting the argument list, and calling fork/exec, with things like random
> number seeding and the like moved into PostgresMain? (ie. the BackendFork
> call would actually be performed by the Postmaster, with BackendFork
> rewritten such that no "global" context is required between the fork and
> exec calls; which'll be what we need to make Win32/CreateProcess changes
> possible). If not, could you give me an idea of what you had intended?

You will see code in postmaster.c that calls
write_nondefault_variables().  That basically dumps out GUC
variables into a binary file to be read in by fork/exec backends.  My
idea is that we will need another similar file for postmaster constants.

The random seed value is unique per-backend, and we want to keep it
secure so we can't pass it on the command line.  I am not sure how to
deal with that.  I hesitate to add a per-backend file to pass such
things.  Does anyone have ideas on how to pass a data value to an
exec()'ed child?  Maybe we have to use a pipe between parent/child and
pass the values that way.

--
  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-hackers-win32 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: fork/exec
Next
From: Tom Lane
Date:
Subject: Re: fork/exec