Re: sinval synchronization considered harmful - Mailing list pgsql-hackers

From Tom Lane
Subject Re: sinval synchronization considered harmful
Date
Msg-id 18073.1311274208@sss.pgh.pa.us
Whole thread Raw
In response to Re: sinval synchronization considered harmful  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: sinval synchronization considered harmful
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> ... On these machines, you need to issue an explicit memory barrier
> instruction at each sequence point, or just acquire and release a
> spinlock.

Right, and the reason that a spinlock fixes it is that we have memory
barrier instructions built into the spinlock code sequences on machines
where it matters.

To get to the point where we could do the sort of optimization Robert
is talking about, someone will have to build suitable primitives for
all the platforms we support.  In the cases where we use gcc ASM in
s_lock.h, it shouldn't be too hard to pull out the barrier
instruction(s) ... but on platforms where we rely on OS-supplied
functions, some research is going to be needed.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: sinval synchronization considered harmful
Next
From: Tom Lane
Date:
Subject: Re: Questions and experiences writing a Foreign Data Wrapper