Boost logo

Boost :

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


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

| From: "Lars Gullik Bjønnes" <larsbj_at_[hidden]>
>> [larsbj_at_trylle smart_ptr]$ ./shared_ptr_mt_test
>> Using POSIX threads: spinlock, 16 threads, 1048576 iterations:
>>
>> 0.000 seconds.
>> no errors detected
>>
>> So yes, it seems to work.
>
| Nice. Unfortunately the time is bogus since clock() measures only the main
| thread. The next step is to check the performance of shared_ptr_timing_test,
| using the pthreads version as a baseline.

atomicity.h:
./shared_ptr_timing_test
4.87

pthreads:
./shared_ptr_timing_test.pthread
2.61

atomic.h without lock:
./shared_ptr_timing_test
2.48

atomic.h with lock:
./shared_ptr_timing_test
4.91

atomicity alwas use the "lock:" modifier(?) in the asm, and that gives
a lot of overhead.

I wonder if the pthreads version on SMP boxes also turn on the lock,
and then becomes just as slow as he atomicity and atomic with lock
versions?

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.

-- 
	Lgb

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