Re: shared memory message queues

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: shared memory message queues
Date: 2013-12-21 09:45:59
Message-ID: 20131221094559.GE15323@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-12-20 22:04:05 +0100, Andres Freund wrote:
> Hi,
>
> On 2013-12-18 15:23:23 -0500, Robert Haas wrote:
> > It sounds like most people who have looked at this stuff are broadly
> > happy with it, so I'd like to push on toward commit soon, but it'd be
> > helpful, Andres, if you could review the comment additions to
> > shm-mq-v2.patch and see whether those address your concerns. If so,
> > I'll see about improving the overall comments for shm-toc-v1.patch as
> > well to clarify the points that seem to have caused a bit of
> > confusion; specific thoughts on what ought to be covered there, or any
> > other review, is most welcome.
>
> Some things:

One more thing:
static uint64
shm_mq_get_bytes_written(volatile shm_mq *mq, bool *detached)
{
uint64 v;

SpinLockAcquire(&mq->mq_mutex);
v = mq->mq_bytes_written;
*detached = mq->mq_detached;
SpinLockRelease(&mq->mq_mutex);

return mq->mq_bytes_written;
}

Note how you're returning mq->mq_bytes_written instead of v.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2013-12-21 09:53:36 Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Previous Message Sergey Konoplev 2013-12-21 09:04:00 Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages