This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: "memory" clobber in synchronization primitives


> Date: Wed, 9 Sep 1998 01:29:21 -0700
> From: Richard Henderson <rth@cygnus.com>

> On Tue, Sep 01, 1998 at 02:24:23PM +1000, Geoff Keating wrote:
> > The actual compare_and_swap procedure has two
> > 'sync' instructions surrounding the main code, which are 'asm
> > volatile' and therefore memory barriers.
> 
> Um, asm_volatile is not a memory barrier.  An asm with an
> explict memory clobber is.

When I said `memory barrier', I meant that gcc will not shift
loads/stores across the barrier.  I think 'asm volatile' guarantees
this---I certainly hope it does.

They should have just explicit memory clobbers anyway, and no
'volatile'.  I think the patch I presented earlier fixes this.

-- 
Geoffrey Keating <geoffk@ozemail.com.au>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]