postgresql/src/backend/storage/ipc
Tom Lane d3fc362ec2 Ensure that all direct uses of spinlock-protected data structures use
'volatile' pointers to access those structures, so that optimizing
compilers will not decide to move the structure accesses outside of the
spinlock-acquire-to-spinlock-release sequence.  There are no known bugs
in these uses at present, but based on bad experience with lwlock.c,
it seems prudent to ensure that we protect these other uses too.
Per pghackers discussion around 12-Dec.  (Note: it should not be
necessary to worry about structures protected by LWLocks, since the
LWLock acquire and release operations are not inline macros.)
2001-12-28 18:16:43 +00:00
..
Makefile Merge three existing ways of signaling postmaster from child processes, 2001-11-04 19:55:31 +00:00
README Postgres95 1.01 Distribution - Virgin Sources 1996-07-09 06:22:35 +00:00
ipc.c New pgindent run with fixes suggested by Tom. Patch manually reviewed, 2001-11-05 17:46:40 +00:00
ipci.c Merge three existing ways of signaling postmaster from child processes, 2001-11-04 19:55:31 +00:00
pmsignal.c New pgindent run with fixes suggested by Tom. Patch manually reviewed, 2001-11-05 17:46:40 +00:00
shmem.c Ensure that all direct uses of spinlock-protected data structures use 2001-12-28 18:16:43 +00:00
shmqueue.c New pgindent run with fixes suggested by Tom. Patch manually reviewed, 2001-11-05 17:46:40 +00:00
sinval.c pgindent run on all C files. Java run to follow. initdb/regression 2001-10-25 05:50:21 +00:00
sinvaladt.c New pgindent run with fixes suggested by Tom. Patch manually reviewed, 2001-11-05 17:46:40 +00:00

README

$Header: /cvsroot/pgsql/src/backend/storage/ipc/README,v 1.1.1.1 1996/07/09 06:21:54 scrappy Exp $
Mon Jul 18 11:09:22 PDT 1988  W.KLAS

Cache invalidation synchronization routines:
===========================================

The cache synchronization is done using a message queue. Every
backend can register a message which then has to be read by
all backends. A message read by all backends is removed from the 
queue automatically. If a message has been lost because the buffer
was full, all backends that haven't read this message will be
noticed that they have to reset their cache state. This is done
at the time when they try to read the message queue.

The message queue is implemented as a shared buffer segment. Actually,
the queue is a circle to allow fast inserting, reading (invalidate data) and
maintaining the buffer.

Access to this shared message buffer is synchronized by the lock manager.
The lock manager treats the buffer as a regular relation and sets
relation level locks (with mode = LockWait) to block backends while 
another backend is writing or reading the buffer. The identifiers used
for this special 'relation' are database id = 0 and relation id = 0.

The current implementation prints regular (e)log information
when a message has been removed from the buffer because the buffer 
is full, and a backend has to reset its cache state. The elog level
is NOTICE. This can be used to improve teh behavior of backends
when invalidating or reseting their cache state.