pgsql: Extend shm_mq API with new functions shm_mq_sendv, shm_mq_set_ha

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Extend shm_mq API with new functions shm_mq_sendv, shm_mq_set_ha
Date: 2014-10-08 18:55:50
Message-ID: E1XbwOs-0002Fd-H9@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2014-10-08 21:24:50 pgsql: Split builtins.h to a new header ruleutils.h
Previous Message pgsql 2014-10-08 13:50:23 pgsql: Tag refs/tags/REL9_4_BETA3 was created