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: Mon, 31 Aug 1998 15:04:36 -0400
   From: Roland McGrath <roland@frob.com>

   What is the general opinion on this?

   It should be well-specified which operations are guaranteed to be memory
   barriers and the set should be consistent across all the ports.

I believe strongly that the x86 should have a memory clobber on all
architectures. 

   Since (at least in GCC)
   any normal function call is a global memory barrier, it may arise seldom
   enough to be subtle and unclear.  The pthreads synchronization primitives
   in linuxthreads are all implemented as normal functions (not macros or
   inlines), so the question has not yet had to be answered.

This is right; if there is a function call, there is no need to add a
memory clobber.  But if there is an inlined function, or a macro, then
a memory clobber should be there.

Thomas


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