exchange_and_add inlined in g++ 4.0.2

bert hubert bert.hubert@netherlabs.nl
Sun Nov 6 00:40:00 GMT 2005


Hi libstdc++ people,

I'm currently profiling one of my applications (the PowerDNS recursor),
succeeding gcc's have managed to speed up this program, kudos!

One of the entries I see in my profiler (oprofile) and in ltrace is
__gnu_cxx::__exchange_and_add

Now, I'd think this would be a function that should be inlined? Indeed, in
the gcc-4.0.2 source, I find an inlined variant in
./libstdc++-v3/config/cpu/i486/atomicity.h but this does not make it to
/opt/gcc-4.0.2 where I've installed gcc-4.0.2.

My three questions are:

	1) Is it really a problem that __gnu_cxx::__exchange_and_add are
non-inlined? 

	2) If so, how do I ./configure gcc to use the 486 inlined version of
__exchange_and_add in libstdc++?

	3) the pdns_recursor is single threaded so I don't actually want
"exchange and add" to be anything special, ie, it need not be atomic. Is
that possible for std::string? Would it mattter?

Thanks!

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services



More information about the Libstdc++ mailing list