postgresql/src/backend
Bruce Momjian a4c40f140d Here's an attempt at new socket and signal code for win32.
It works on the principle of turning sockets into non-blocking, and then
emulate blocking behaviour on top of that, while allowing signals to
run. Signals are now implemented using an event instead of APCs, thus
getting rid of the issue of APCs not being compatible with "old style"
sockets functions.

It also moves the win32 specific code away from pqsignal.h/c into
port/win32, and also removes the "thread style workaround" of the APC
issue previously in place.

In order to make things work, a few things are also changed in pgstat.c:

1) There is now a separate pipe to the collector and the bufferer. This
is required because the pipe will otherwise only be signalled in one of
the processes when the postmaster goes down. The MS winsock code for
select() must have some kind of workaround for this behaviour, but I
have found no stable way of doing that. You really are not supposed to
use the same socket from more than one process (unless you use
WSADuplicateSocket(), in which case the docs specifically say that only
one will be flagged).

2) The check for "postmaster death" is moved into a separate select()
call after the main loop. The previous behaviour select():ed on the
postmaster pipe, while later explicitly saying "we do NOT check for
postmaster exit inside the loop".
The issue was that the code relies on the same select() call seeing both
the postmaster pipe *and* the pgstat pipe go away. This does not always
happen, and it appears that useing WSAEventSelect() makes it even more
common that it does not.
Since it's only called when the process exits, I don't think using a
separate select() call will have any significant impact on how the stats
collector works.

Magnus Hagander
2004-04-12 16:19:18 +00:00
..
access This is a cleanup patch for access/transam/xact.c. It only removes some 2004-04-05 03:11:39 +00:00
bootstrap Replace TupleTableSlot convention for whole-row variables and function 2004-04-01 21:28:47 +00:00
catalog check_sql_fn_retval has always thought that we supported doing 2004-04-02 23:14:08 +00:00
commands ALTER SEQUENCE RESTART did the wrong thing if sequence last_value was 2004-04-06 16:39:30 +00:00
executor Still another place to make the world safe for zero-column tables. 2004-04-07 18:46:12 +00:00
lib make sure the $Id tags are converted to $PostgreSQL as well ... 2003-11-29 22:41:33 +00:00
libpq Here's an attempt at new socket and signal code for win32. 2004-04-12 16:19:18 +00:00
main Windows uses codepages rather than the environment, so we work around 2004-03-15 16:14:26 +00:00
nodes Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END 2004-03-17 20:48:43 +00:00
optimizer Extend set-operation planning to keep track of the sort ordering induced 2004-04-07 18:17:25 +00:00
parser Allow LIKE/ILIKE to appear in more places in a query. 2004-04-05 03:07:26 +00:00
po Translation updates 2004-04-09 06:49:35 +00:00
port Here's an attempt at new socket and signal code for win32. 2004-04-12 16:19:18 +00:00
postmaster Here's an attempt at new socket and signal code for win32. 2004-04-12 16:19:18 +00:00
regex $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
rewrite Replace TupleTableSlot convention for whole-row variables and function 2004-04-01 21:28:47 +00:00
storage When changing select() calls for delays into pg_usleep(), two comments 2004-03-23 21:39:46 +00:00
tcop Exit backend from SIGTERM or FATAL by simulating client EOF, rather than 2004-04-11 00:54:45 +00:00
utils Exit backend from SIGTERM or FATAL by simulating client EOF, rather than 2004-04-11 00:54:45 +00:00
Makefile Briefly, 2004-02-02 00:11:31 +00:00
nls.mk $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00