This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: locks on X86
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Subject: Re: locks on X86
- From: Tom Tromey <tromey at redhat dot com>
- Date: 23 Apr 2001 11:31:43 -0600
- Cc: java at gcc dot gnu dot org, "'drepper at redhat dot com'" <drepper at redhat dot com>
- References: <140D21516EC2D3119EE7009027876644049B5CA0@hplex1.hpl.hp.com>
- Reply-To: tromey at redhat dot com
>>>>> "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