MIPS deadlock bug fix

Godmar Back gback at cs.utah.edu
Tue Jan 9 11:34:42 PST 2001


> 
> With this fix I seem to have no more unexpected deadlocks.
> Just to be on the safe side, does anyone know of similar
> "supposed to be atomic" operations?
> 

Not that, but we've repeatedly pointed out that the CMPEXCH
in locks.c in broken.  By now, we've wasted more time discussing
this subject than it would take to just remove, so below it goes.

I didn't put in your generic version in order to encourage
you and others to look through your MIPS manual and submit a
working md version.  We don't want to make kaffe too easy to port ;-)

	- Godmar


Index: locks.c
===================================================================
RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/locks.c,v
retrieving revision 1.39
diff -u -r1.39 locks.c
--- locks.c     2000/12/03 03:25:08     1.39
+++ locks.c     2001/01/09 19:32:47
@@ -44,8 +44,7 @@
                (val == (O) ? 1 :  0); \
        })
 #else
-#define        COMPARE_AND_EXCHANGE(A,O,N) \
-       (*(A) == (O) ? *(A) = (N), 1 : 0)
+#error Please define COMPARE_AND_EXCHANGE or ATOMIC_EXCHANGE 
 #endif
 #endif




More information about the kaffe mailing list