[Mono-bugs] [Bug 74639][Nor] Changed - instruction sync needed for atomic.h on ppc

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 19 Apr 2005 07:37:14 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lupus@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=74639

--- shadow/74639	2005-04-18 19:54:14.000000000 -0400
+++ shadow/74639.tmp.24781	2005-04-19 07:37:14.000000000 -0400
@@ -62,6 +62,19 @@
                               "isync\n\t"
                               : "=&r" (result): "r" (val): "cc",
 "memory");
         return result;
 }
 
+
+------- Additional Comments From lupus@ximian.com  2005-04-19 07:37 -------
+The patch is incorrect: it breaks the correct code that I committed in
+svn.
+As for the memory barriers: it's not enough to sprinkle isync here and
+there. Sometime you need a sync instruction if the interlocked
+functions are used to implement locks with defined memory order
+semantics. Whether the latter is the correct thing to do is not clear,
+since the interlocked API doesn't give such guarantees. Note, in fact,
+as the MemoryBarrier API was added even to win32 to be able to deal
+with this issue.
+Adding memory barriers everywhere may help to fix broken code, but it
+will also slowdown everything.