Re: Pre-forking backend

Jan Wieck <janwieck@yahoo.com>

From: Jan Wieck <JanWieck@Yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2001-09-30T04:40:49Z
Lists: pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > How hard would it be to pre-fork an extra backend
>
> How are you going to pass the connection socket to an already-forked
> child process?  AFAIK there's no remotely portable way ...

    One  of  the mechanisms I've seen was that the master process
    just does the socket(), bind(), listen(), than forks off  and
    the  children  coordinate via a semaphore that at most one of
    them executes a blocking accept(). I think  it  was  in  some
    older apache release.

    But  in  contrast  to  apache,  we  currently  do most of the
    initialization after we authenticated the user and know  what
    database to connect to.  I'm not sure how much of the backend
    startup could be done before accepting the connection.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com