Boost logo

Boost :

From: Lars Gullik Bjønnes (larsbj_at_[hidden])
Date: 2002-05-15 15:35:57


"Peter Dimov" <pdimov_at_[hidden]> writes:

>> Anyway it seems that there is no gain over pthreades either way.
>> But what does the performance comment in lwm_linux.hpp really talk
>> about? I see nothing near a 3.5 times higher performace anywhere.
>
| I'm getting 1.85 with asm/atomic.h, 2.3 with the stub pthreads
| (without -lpthread) and 6.85 with -lpthread. (Red Hat 7.1, g++ 2.96.)

Ok, I ran the tests again with -pthread turned on explicitly for all
compiles. This time the results are a bit more like I would have
expected: (average over 5 runs)

atomic: (without asm "lock ;") (only safe on a non-smp box)
2.60

atomic: (with asm "lock ;") (this is what would be used on a smp box)
5.23

atomicity: (with asm "lock ;")
5.15

pthread:
9.18

This is with Gcc 3.1 on a RH 7.3 dist, compiled with -O2

The 'atomic without asm "lock ;"' is not safe if used on a non-smp
box, this is also presumely why gcc/libstdc++ has choosen to always
use the "lock ;"

-- 
	Lgb

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk