Re: shared memory message queues - Mailing list pgsql-hackers

From Andres Freund
Subject Re: shared memory message queues
Date
Msg-id 20131221094559.GE15323@alap2.anarazel.de
Whole thread Raw
In response to Re: shared memory message queues  (Andres Freund <andres@2ndquadrant.com>)
List 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



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: ISN extension bug?
Next
From: David Rowley
Date:
Subject: Re: [PATCH] Negative Transition Aggregate Functions (WIP)