Re: spinlocks on HP-UX - Mailing list pgsql-hackers

From Tom Lane
Subject Re: spinlocks on HP-UX
Date
Msg-id 8434.1314642110@sss.pgh.pa.us
Whole thread Raw
In response to Re: spinlocks on HP-UX  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I'm actually not convinced that we're entirely consistent here about
> what we require the semantics of acquiring and releasing a spinlock to
> be.  For example, on x86 and x86_64, we acquire the lock using xchgb,
> which acts a full memory barrier.  But when we release the lock, we
> just zero out the memory address, which is NOT a full memory barrier.
> Stores can't cross it, but non-dependent loads of different locations
> can back up over it.  That's pretty close to a full barrier, but it
> isn't, quite.

Right.  That's why I wrote the comment as I did; it says what the actual
requirement is.  There probably are cases where our implementations are
more restrictive than necessary (I hope none where they are weaker).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: spinlocks on HP-UX
Next
From: Robert Haas
Date:
Subject: Re: spinlocks on HP-UX