git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 85a2a89) | patch
Add a default local latch for use in signal handlers.
2015年1月14日 17:45:22 +0000 (18:45 +0100)
2015年1月14日 17:45:22 +0000 (18:45 +0100)
commit 59f71a0d0b56b2df48db4bf1738aece5551f7a47
Add a default local latch for use in signal handlers.

To do so, move InitializeLatchSupport() into the new common process
initialization functions, and add a new global variable MyLatch.

MyLatch is usable as soon InitPostmasterChild() has been called
(i.e. very early during startup). Initially it points to a process
local latch that exists in all processes. InitProcess/InitAuxiliaryProcess
then replaces that local latch with PGPROC->procLatch. During shutdown
the reverse happens.

This is primarily advantageous for two reasons: For one it simplifies
dealing with the shared process latch, especially in signal handlers,
because instead of having to check for MyProc, MyLatch can be used
unconditionally. For another, a later patch that makes FEs/BE
communication use latches, now can rely on the existence of a latch,
even before having gone through InitProcess.

Discussion: 20140927191243.GD5423@alap3.anarazel.de
23 files changed:
src/backend/postmaster/autovacuum.c diff | blob | blame | history
src/backend/postmaster/bgworker.c diff | blob | blame | history
src/backend/postmaster/bgwriter.c diff | blob | blame | history
src/backend/postmaster/checkpointer.c diff | blob | blame | history
src/backend/postmaster/pgarch.c diff | blob | blame | history
src/backend/postmaster/pgstat.c diff | blob | blame | history
src/backend/postmaster/syslogger.c diff | blob | blame | history
src/backend/postmaster/walwriter.c diff | blob | blame | history
src/backend/replication/syncrep.c diff | blob | blame | history
src/backend/storage/ipc/procsignal.c diff | blob | blame | history
src/backend/storage/ipc/shm_mq.c diff | blob | blame | history
src/backend/storage/lmgr/proc.c diff | blob | blame | history
src/backend/tcop/postgres.c diff | blob | blame | history
src/backend/utils/adt/misc.c diff | blob | blame | history
src/backend/utils/init/globals.c diff | blob | blame | history
src/backend/utils/init/miscinit.c diff | blob | blame | history
src/backend/utils/misc/timeout.c diff | blob | blame | history
src/include/miscadmin.h diff | blob | blame | history
src/include/storage/latch.h diff | blob | blame | history
src/test/modules/test_shm_mq/setup.c diff | blob | blame | history
src/test/modules/test_shm_mq/test.c diff | blob | blame | history
src/test/modules/test_shm_mq/worker.c diff | blob | blame | history
src/test/modules/worker_spi/worker_spi.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /