Robert Haas <> writes:
> On Tue, Jul 31, 2012 at 4:06 PM, Tom Lane <> wrote:
>> I agree that volatile-izing everything in the vicinity is a sucky
>> solution, but the last time we looked at this there did not seem to
>> be a better one.

> Well, Linux has a barrier() primitive which is defined as a
> compiler-barrier, so I don't see why we shouldn't be able to manage
> the same thing.  In fact, we've already got it, though it's presently
> unused; see storage/barrier.h.

Solving the problem for linux only, or gcc only, isn't going to get us
to a place where we can stop volatile-izing call sites.  We need to be
sure it works for every single case supported by s_lock.h.

I think you may be right that using __asm__ __volatile__ in gcc
S_UNLOCK cases would be a big step forward, but it needs more research
to see if that's the only fix needed.

                        regards, tom lane

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to