Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Dirk Grunwald <grunwald@foobar.cs.colorado.edu>
Subject: Re: Memory consistency problems on the 8400
Date: 1997/03/25	[thread overview]
Message-ID: <qxpu3lznvpc.fsf@foobar.cs.colorado.edu> (raw)
In-Reply-To: w4k67yfygr4.fsf@pine.comlab


> from Digital WRL labs [2], which discusses write fences on the
> alpha. Is there a system call for performing a memory fence on the
> Alpha? i.e., something akin to the following operation which is
> available on the T3E?
--

Yeah, it's the memory barrier instruction.  Depending on your C
compiler, you can generate it in a number of ways. I believe that
the _mb() routine in /usr/lib/libc.a is simply a memory barrier
instruction wrapped in a procedure call.

Here's an example of a proper mutex on an Alpha, from the
pthread include file.

# define pthread_mutex_lock_prim(_m_) asm (" \
	ldah	%t2,0x10(%r31) ;\
    10: ldl_l	%v0,(%a0) ;\
	bne	%v0,30f ;\
	or	%v0,%t2,%t0 ;\
	stl_c	%t0,(%a0) ;\
	beq	%t0,20f ;\
	mb	; \
	br	%r31,30f ;\
    20: br	%r31,10b ;\
    30:", &(_m_)->_Pfield(lock))


-- 
Dirk Grunwald                 Assoc. Prof, Univ. of Colorado at Boulder



  reply	other threads:[~1997-03-25  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-25  5:00 Memory consistency problems on the 8400 Jonathan Hill
1997-03-25  5:00 ` Dirk Grunwald [this message]
1997-03-26  5:00 ` Stephen Hoff Hoffman
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox