> Gavin Sherry <[EMAIL PROTECTED]> writes:
> 
> > This aside, isn't it possible to just copy the socket and some
> > data about the database required into shared memory and have the preforked
> > children pick the socket up from there.
> 
> Ummm....  No.  There's no Unix API for doing so.
> 
> You can pass open file descriptors across Unix domain sockets on most
> systems, which is a possible way to address the problem, but probably
> not worth it for the reasons discussed earlier.

OK, let's assume we have pre-forked backends that do the accept().  One
enhancement would be for the child to connect to the last requested
database.  If the accept() user wants the same database, it is already
connected, or at least its cache is loaded.  If they want another one,
we can disconnect and connect to the database they request.  This would
be portable for all OS's because there is no file descriptor passing.

Added to TODO:

* Have pre-forked backend pre-connect to last requested database or pass
  file descriptor to backend pre-forked for matching database
 
-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to