agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Magnus Hagander <mha@sollentuna.net>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: refactoring fork() and EXEC_BACKEND
Date: Sat, 05 Mar 2005 19:59:47 +1100
Message-ID: <42297503.20604@samurai.com> (raw)
In-Reply-To: <6BCB9D8A16AC4241919521715F4D8BCE476A3C@algol.sollentuna.se>
References: <6BCB9D8A16AC4241919521715F4D8BCE476A3C@algol.sollentuna.se>

Magnus Hagander wrote:
> This is a lot like what I was planning to work towards with the
> refactoring of the forkexec code I promised to do for 8.1.

Cool. BTW, have we accepted that EXEC_BACKEND is the way we're going to 
workaround the lack of fork() on Win32 for the foreseeable future? I 
mean, it _works_, but it's slow, ugly, and complicates the code. If it's 
the only workable option for Win32 support, then fair enough -- I just 
don't know enough of the Win32 API to know if there's a better 
alternative out there (short of using threads, which is of course not 
really plausible).

> I was actually thinking of not passing these on the commandline at all,
> in order to avoid possible quoting issues etc (recall all the problems
> with the stupid commandline processing on win32). Instead moving it into
> a struct that is appended to the end of the backend variable file/shared
> memory.

Sounds good to me. Finding a cleaner way to pass data to the child 
process than writing it out to a file would also be nice, if possible. 
Again, I'm not sure what options there are on Win32...

> That was also what I was thinking. Let me know if you want to split the
> load somewhere :-)

Given that you're planning to work on this, I've scaled back my 
ambitions. I'll send a patch to -patches that just cleans up fork() and 
doesn't change the EXEC_BACKEND case. So fork_process() will:

- flush stderr/stdout
- save and restore the profiling timer if LINUX_PROFILE is defined
- handle BeOS

which means it should not be very invasive. Of course, there is plenty 
of room for improvement -- if you're interested in taking a look, please 
do...

-Neil



view thread (6+ messages)  latest in thread

Message-ID: <42297503.20604@samurai.com>
Permalink:  ../../42297503.20604@samurai.com/
Also on:    postgresql.org/message-id/42297503.20604@samurai.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: neilc@samurai.com, mha@sollentuna.net
  Subject: Re: refactoring fork() and EXEC_BACKEND
  In-Reply-To: <42297503.20604@samurai.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox