On Mon, Aug 29, 2011 at 4:07 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> * ANOTHER CAUTION: be sure that TAS(), TAS_SPIN(), and
>> S_UNLOCK() represent
>> * sequence points, ie, loads and stores of other values must not be moved
>> * across a lock or unlock. In most cases it suffices to make
>> the operation
>> * be done through a "volatile" pointer.
>> IIUC, this is basically total nonsense.
> It could maybe be rewritten for more clarity, but it's far from being
The confusion for me is that it's talking about sequence points and
volatile pointers in the same breath as if one implies the other.
Making something a volatile pointer dose not create a sequence point.
It requires that the compiler not move the access or store across any
sequence points that are already there.
It might be helpful to include the actual bug that the comment is
trying to warn against because iirc it was a real case that caused you
to add the volatile modifiers.
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2011-08-29 16:00:08|
|Subject: Re: spinlocks on HP-UX |
|Previous:||From: Robert Haas||Date: 2011-08-29 15:47:48|
|Subject: Re: spinlocks on HP-UX|