exchange_and_add inlined in g++ 4.0.2

Paolo Carlini pcarlini@suse.de
Mon Nov 7 13:25:00 GMT 2005


Peter Dimov wrote:

> Paolo Carlini wrote:
>
>> A bit of additional info, in case you missed some of yesterday
>> messages. Given the cost of a function call on P4 (~10 cycles) vs
>> that of an atomic (~ 500-1000 cycles) it's unlikely that your profile
>> would change much if the atomics are inlined.
>
> Some configurations may suffer a 1000 cycles penalty (quad Xeons would
> be my guess - I've never observed that), but the average case isn't
> _that_ bad. On my Athlon I'm seeing the following numbers:

Thanks Peter. As you may easily guess from my latest messages to the
lists, I'm doing my best to convince people that we should strive to
inline the builtin atomics on the modern machines anyway. Hopefully we
can manage to have that in a way compatible with the packaging and
portability needs...

Paolo.



More information about the Libstdc++ mailing list