This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
exchange_and_add inlined in g++ 4.0.2
- From: bert hubert <bert dot hubert at netherlabs dot nl>
- To: libstdc++ at gcc dot gnu dot org
- Date: Sun, 6 Nov 2005 01:40:37 +0100
- Subject: exchange_and_add inlined in g++ 4.0.2
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