Using __kuser_cmpxchg

Nicolas Pitre nico@cam.org
Tue Nov 20 14:06:00 GMT 2007


On Mon, 19 Nov 2007, Boehm, Hans wrote:

> FWIW:  The C++ atomics library that was recently voted into the C++
> working paper
> (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html )
> allows "spurious" "compare_swap" failures, and returns both the read
> value, and
> whether or not the CAS succeeded.  It would be nice if the kernel
> interface
> allowed that to be implemented as efficiently as possible.

Well, given that the version without spurious failure is 5 instructions 
instead of 7 for the non-ARMv6 version, and 7 instead of 5 for the 
ARMv6+ version, I don't think that going with the version without 
spurious errors all the time will make much of a difference in 
performance.  In fact the non ARMv6 version which is actually the 
important one (since optimized ARMv6 binaries may implement it inline 
anyway) is now _more_ efficient than before.


Nicolas



More information about the Java mailing list