pgsql: Extend shm_mq API with new functions shm_mq_sendv, shm_mq_set_ha - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Extend shm_mq API with new functions shm_mq_sendv, shm_mq_set_ha
Date
Msg-id E1XbwOs-0002Fd-H9@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Extend shm_mq API with new functions shm_mq_sendv, shm_mq_set_handle.

shm_mq_sendv sends a message to the queue assembled from multiple
locations.  This is expected to be used by forthcoming patches to
allow frontend/backend protocol messages to be sent via shm_mq, but
might be useful for other purposes as well.

shm_mq_set_handle associates a BackgroundWorkerHandle with an
already-existing shm_mq_handle.  This solves a timing problem when
creating a shm_mq to communicate with a newly-launched background
worker: if you attach to the queue first, and the background worker
fails to start, you might block forever trying to do I/O on the queue;
but if you start the background worker first, but then die before
attaching to the queue, the background worrker might block forever
trying to do I/O on the queue.  This lets you attach before starting
the worker (so that the worker is protected) and then associate the
BackgroundWorkerHandle later (so that you are also protected).

Patch by me, reviewed by Stephen Frost.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7bb0e97407c32cbf7245ef91fcc27d120c81e872

Modified Files
--------------
src/backend/storage/ipc/shm_mq.c |  126 +++++++++++++++++++++++++++++++++-----
src/include/storage/shm_mq.h     |   14 ++++-
2 files changed, 124 insertions(+), 16 deletions(-)


pgsql-committers by date:

Previous
From: pgsql@postgresql.org
Date:
Subject: pgsql: Tag refs/tags/REL9_4_BETA3 was created
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Split builtins.h to a new header ruleutils.h