define memory fence asm code.
authorGengbin Zheng <gzheng@illinois.edu>
Sun, 14 Oct 2007 06:49:31 +0000 (06:49 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Sun, 14 Oct 2007 06:49:31 +0000 (06:49 +0000)
src/conv-core/converse.h

index 40cfbf3250c17da8da64e170cd363c85a4eddb6f..96eae55d7ff32ea5ffda854a6db824e5702cb502 100644 (file)
@@ -1449,6 +1449,16 @@ extern int _immRunning;
 #  define CmiImmIsRunning()       (0)
 #endif
 
+/******** Memory Fence ********/
+
+#if  CMK_AMD64
+#define smp_rmb()    asm volatile("lfence":::"memory")
+#define smp_wmb()    asm volatile("sfence" ::: "memory")
+#else
+#define smp_rmb()
+#define smp_wmb()
+#endif
+
 /******** Performance Counters ********/
 void CmiInitCounters();
 void CmiStartCounters(int events[], int numEvents);