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


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~


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