From cfeca62148582a05466362f1957572f5a9900ab5 Mon Sep 17 00:00:00 2001 From: Jan Wieck Date: Wed, 19 Nov 2003 15:55:08 +0000 Subject: Background writer process This first part of the background writer does no syncing at all. It's only purpose is to keep the LRU heads clean so that regular backends seldom to never have to call write(). Jan --- src/backend/bootstrap/bootstrap.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/backend/bootstrap/bootstrap.c') diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index cfd8a553582..bb67feab71f 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.166 2003/09/02 19:04:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.167 2003/11/19 15:55:07 wieck Exp $ * *------------------------------------------------------------------------- */ @@ -428,8 +428,20 @@ BootstrapMain(int argc, char *argv[]) BaseInit(); + /* needed to get LWLocks */ if (IsUnderPostmaster) - InitDummyProcess(); /* needed to get LWLocks */ + { + switch (xlogop) + { + case BS_XLOG_BGWRITER: + InitDummyProcess(DUMMY_PROC_BGWRITER); + break; + + default: + InitDummyProcess(DUMMY_PROC_DEFAULT); + break; + } + } /* * XLOG operations @@ -453,6 +465,11 @@ BootstrapMain(int argc, char *argv[]) * postmaster */ proc_exit(0); /* done */ + case BS_XLOG_BGWRITER: + CreateDummyCaches(); + BufferBackgroundWriter(); + proc_exit(0); /* done */ + case BS_XLOG_STARTUP: StartupXLOG(); LoadFreeSpaceMap(); -- cgit v1.2.3