Question about atomic builtin functions in gcc for rtems.
marcos.diaz at tallertechnologies.com
Wed Aug 12 20:28:02 UTC 2015
Hi, i was using some c++11 concurrency classes on ARM (with gcc 4.9.2) that
have an underlying use of libgcc atomic functions, for
example __gnu_cxx::__atomic_add_dispatch. In its implementation, (in the
file gcc-sources/libstdc++-v3/include/ext/atomicity.h) I can see that the
macro _GLIBCXX_ATOMIC_BUILTINS is not defined, and therefore the builtin
implementation of __atomic_fetch_add is not used. Instead, the mutex
implementation is used which makes it significantly slower.
As far as I could see, if I explicitly call one of these atomic built-in
functions they work ok and the correct atomic assembly is emitted (using
ARM's ldrex and strex instructions).
So, the question is why this _GLIBCXX_ATOMIC_BUILTINS macro is disabled.
is there a reason why we aren't using the atomic builtins, or I need to
enable it. How can we do the enabling? Is the implementation incomplete?
San Lorenzo 47, 3rd Floor, Office 5
Phone: +54 351 4217888 / +54 351 4218211/ +54 351 7617452
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel