postgresql/src/include
Heikki Linnakangas 89fd72cbf2 Introduce a pipe between postmaster and each backend, which can be used to
detect postmaster death. Postmaster keeps the write-end of the pipe open,
so when it dies, children get EOF in the read-end. That can conveniently
be waited for in select(), which allows eliminating some of the polling
loops that check for postmaster death. This patch doesn't yet change all
the loops to use the new mechanism, expect a follow-on patch to do that.

This changes the interface to WaitLatch, so that it takes as argument a
bitmask of events that it waits for. Possible events are latch set, timeout,
postmaster death, and socket becoming readable or writeable.

The pipe method behaves slightly differently from the kill() method
previously used in PostmasterIsAlive() in the case that postmaster has died,
but its parent has not yet read its exit code with waitpid(). The pipe
returns EOF as soon as the process dies, but kill() continues to return
true until waitpid() has been called (IOW while the process is a zombie).
Because of that, change PostmasterIsAlive() to use the pipe too, otherwise
WaitLatch() would return immediately with WL_POSTMASTER_DEATH, while
PostmasterIsAlive() would claim it's still alive. That could easily lead to
busy-waiting while postmaster is in zombie state.

Peter Geoghegan with further changes by me, reviewed by Fujii Masao and
Florian Pflug.
2011-07-08 18:44:07 +03:00
..
access Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
bootstrap Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
catalog Fix bugs in relpersistence handling during table creation. 2011-07-03 17:34:47 -04:00
commands Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
executor Install defenses against overflow in BuildTupleHashTable(). 2011-05-23 12:52:46 -04:00
foreign pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
lib Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
libpq Modernise pg_hba.conf token processing 2011-06-28 15:57:24 -04:00
mb Fix char2wchar/wchar2char to support collations properly. 2011-04-23 12:35:41 -04:00
nodes Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h 2011-07-04 14:35:58 -04:00
optimizer Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
parser Add notion of a "transform function" that can simplify function calls. 2011-06-21 22:21:24 -04:00
port Revert "Force use of "%I64d" format for 64 bit ints on MinGW." 2011-04-27 14:55:18 -04:00
portability Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
postmaster Introduce a pipe between postmaster and each backend, which can be used to 2011-07-08 18:44:07 +03:00
regex Teach regular expression operators to honor collations. 2011-04-10 18:03:09 -04:00
replication pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
rewrite Add a missing_ok argument to get_object_address(). 2011-06-27 21:19:31 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Introduce a pipe between postmaster and each backend, which can be used to 2011-07-08 18:44:07 +03:00
tcop Revise the API for GUC variable assign hooks. 2011-04-07 00:12:02 -04:00
tsearch pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
utils Reclassify replication-related GUC variables as "master" and "standby". 2011-07-07 15:11:41 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
c.h Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
fmgr.h Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
funcapi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
getaddrinfo.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
getopt_long.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
Makefile Add maintainer-check target 2011-03-28 22:56:52 +03:00
miscadmin.h Add postmaster/postgres undocumented -b option for binary upgrades. 2011-04-25 12:00:21 -04:00
pg_config.h.in Start using flexible array members 2011-06-16 22:45:38 +03:00
pg_config.h.win32 Set FLEXIBLE_ARRAY_MEMBER to empty for MSVC. 2011-06-17 18:22:03 -04:00
pg_config_manual.h Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
pg_trace.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pgstat.h Fix VACUUM so that it always updates pg_class.reltuples/relpages. 2011-05-30 17:06:52 -04:00
pgtime.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
port.h Add \ir command to psql. 2011-07-06 11:45:13 -04:00
postgres.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
postgres_ext.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres_fe.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
rusagestub.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
windowapi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00