Hello,

why there is no cas-based version of __exchange_and_add for 32-bit
mode Sparcs in libstdc++, namely in config/cpu/sparc/atomicity.h ?
There is spinlock-based generic code for all Sparcs, but V9 does support
32-bit cas, which can be used instead of a spinlock. This spinlock

_Atomicity_lock<__inst>::_S_atomicity_lock

causes serious scalability problems with std::string. On a machine with
4 processors our 32-bit code is only about 2.3 times faster that on a
uniprocessor. When I hack atomicity.h, providing my own cas-based
__exchange_and_add, it works nearly 4 times faster compared to a UP.

Is it possible to replace __exchange_and_add with my code without
patching libstdc++? Unfortunately it is impossible to provide a generic
patch for atomicity.h, because GCC does not define __sparcv9 in
32-bit mode, as described in this thread:

http://gcc.gnu.org/ml/gcc/2005-11/msg00842.html

    Best regards
    Piotr Wyderski
 

Reply via email to