[cpp-threads] modes

Peter Dimov pdimov at mmltd.net
Sun May 8 01:50:26 BST 2005


Doug Lea wrote:

> Aside: I haven't checked this in about 3 years, but at the time,
> incrementing using CAS (with retry) on x86-smps I had around was not
> reliably slower than locked add.

On my AMD Athlon 2500+ uniprocessor, CAS is about 4% slower (CAS time ~= 
1.04 times lock xadd time).

On an Intel 3.2 GHz with HT uniprocessor, CAS is reportedly 87% slower (CAS 
time ~= 1.87 lock xadd time).

Dual Intel results maybe tomorrow.

The test I used is shared_ptr_mt_test.cpp:

http://boost-consulting.com/boost/libs/smart_ptr/test/shared_ptr_mt_test.cpp

It basically does ~1.5M shared_ptr copies per thread in 16 threads. 





More information about the cpp-threads mailing list