This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: "memory" clobber in synchronization primitives
- To: Geoff Keating <geoffk@ozemail.com.au>, roland@frob.com
- Subject: Re: "memory" clobber in synchronization primitives
- From: Richard Henderson <rth@cygnus.com>
- Date: Wed, 9 Sep 1998 01:41:24 -0700
- Cc: drepper@cygnus.com, libc-hacker@gnu.org
- References: <199809010503.BAA18697@baalperazim.frob.com> <199809031149.VAA28143@geoffk.wattle.id.au>
- Reply-To: Richard Henderson <rth@cygnus.com>
On Thu, Sep 03, 1998 at 09:49:01PM +1000, Geoff Keating wrote:
> So, I propose the attached patch. The only addition is a new macro,
>
> #define enforce_memory_ordering() asm ("" : : : "memory")
I think that this is generally a good idea.
> +++ libc/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
> @@ -19,6 +19,7 @@
> not, write to the Free Software Foundation, Inc.,
> 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
>
> +#define enforce_memory_ordering() asm ("stbar" : : : "memory")
This is actually
membar #StoreLoad|#StoreStore
Sparcv9 has a very fine-grained sync primitive.
r~