locks on X86
Tom Tromey
tromey@redhat.com
Mon Apr 23 10:23:00 GMT 2001
>>>>> "Hans" == Boehm, Hans <hans_boehm@hp.com> writes:
Digging through some old email...
Hans> - cmpxchg without a lock prefix is much faster (roughly 3x or
Hans> close to 15 cycles by my measurements) than either xchg (implied
Hans> lock prefix) or lock; cmpxchg .
Hans> - cmpxchg without the lock prefix is atomic on uniprocessors,
Hans> i.e. it's not interruptable.
Hans> As far as I can tell, none of the GNU libraries currently take
Hans> advantage of this fact. Should they?
I wonder if there is some way to abuse ld.so to add or remove the
prefix based on whether the system is MP. This might be worthwhile if
the number of locks is small enough. For one thing it wouldn't
require building two separate versions of all the code.
Tom
More information about the Java
mailing list