summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-09-11 15:48:04 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-09-11 15:48:04 +0000
commit2746e5f21d4dce07ee55c58b2035ff631470577f (patch)
tree421c208e30bc3ac7cae8c6282a1304595dfaa625 /configure.in
parent81624db39aa7501690aab71a68af689df78b71e8 (diff)
downloadpostgresql-2746e5f21d4dce07ee55c58b2035ff631470577f.tar.gz
Introduce latches. A latch is a boolean variable, with the capability to
wait until it is set. Latches can be used to reliably wait until a signal arrives, which is hard otherwise because signals don't interrupt select() on some platforms, and even when they do, there's race conditions. On Unix, latches use the so called self-pipe trick under the covers to implement the sleep until the latch is set, without race conditions. On Windows, Windows events are used. Use the new latch abstraction to sleep in walsender, so that as soon as a transaction finishes, walsender is woken up to immediately send the WAL to the standby. This reduces the latency between master and standby, which is good. Preliminary work by Fujii Masao. The latch implementation is by me, with helpful comments from many people.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 4b2e88d15a..a4ba42e7dc 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.633 2010/07/09 04:10:58 tgl Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.634 2010/09/11 15:48:04 heikki Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -1700,6 +1700,13 @@ else
SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
fi
+# Select latch implementation type.
+if test "$PORTNAME" != "win32"; then
+ LATCH_IMPLEMENTATION="src/backend/port/unix_latch.c"
+else
+ LATCH_IMPLEMENTATION="src/backend/port/win32_latch.c"
+fi
+
# If not set in template file, set bytes to use libc memset()
if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
MEMSET_LOOP_LIMIT=1024
@@ -1841,6 +1848,7 @@ AC_CONFIG_LINKS([
src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c
src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}
src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}
+ src/backend/port/pg_latch.c:${LATCH_IMPLEMENTATION}
src/include/dynloader.h:src/backend/port/dynloader/${template}.h
src/include/pg_config_os.h:src/include/port/${template}.h
src/Makefile.port:src/makefiles/Makefile.${template}