MIPS deadlock bug fix
M.Kizub at post.skynet.lt
Wed Jan 10 01:09:31 PST 2001
-----BEGIN PGP SIGNED MESSAGE-----
Wednesday, January 10, 2001, 8:52:51 AM, you wrote:
SW> Hello Godmar,
SW> It's good to know that someone is listening who can do
SW> something with the comment.
>>> 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
SW> I known my MIPS manual by hart. Unfortunately, an original R3000
SW> processor core has no instructions to provide an atomic exchange
SW> an atomic compare and exchange. I there were, I definitely would
SW> used that as that seemed to be the proper action. Maybe an R4000
SW> (which has a store conditional instruction) might be able to do
SW> but on an R3000 you are really out of luck. If I hadn't used the
SW> "jthread_suspendall" call then I would have to switch to kernel
SW> to disable interrupts....
>> #error Please define COMPARE_AND_EXCHANGE or ATOMIC_EXCHANGE
SW> I agree that this is better than the broken macro. It would have
SW> the time I spent in finding the problem. Yet COMPARE_AND_EXCHANGE
SW> is only defined for i386 architectures and ATOMIC_EXCHANGE is
SW> defined (at least in the Kaffe 1.0.6 sources). So a working
SW> might not be that bad. And some embedded/old processor cores
SW> don't have these very convenient instructions.
Probably, you can use something like:
compare and exchange
Maxim mailto:M.Kizub at post.skynet.lt
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5i
-----END PGP SIGNATURE-----
More information about the kaffe