|
Boost : |
From: Michael van der Westhuizen (r1mikey_at_[hidden])
Date: 2006-07-08 12:45:18
Hi Peter,
On 7/8/06, Peter Dimov <pdimov_at_[hidden]> wrote:
> Michael van der Westhuizen wrote:
> > On 7/8/06, Peter Dimov <pdimov_at_[hidden]> wrote:
> >> Thanks. I've attached my current version of
> >> sp_counted_base_gcc_sparc.hpp. Does it look correct to you?
> >
> > compare_and_swap certainly looks correct.
> >
> Yes indeed. I've attached a fixed version.
Ok, it looks like I spoke too soon. I was getting core dumps on
weak_ptr_mt_test until I changed compare_and_swap to this:
inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_,
int32_t swap_ )
{
__asm__ __volatile__( "cas [%2], %3, %0"
: "=&r"(compare_), "=m"(*dest_)
: "r"(dest_), "r"(compare_), "0"(swap_), "m"(*dest_)
: "memory" );
return compare_;
}
After that, all mt tests pass.
I also had to change the selector code in detail/sp_counted_base to this:
#elif defined(__GNUC__) && ( defined(__sparcv8) || defined(__sparcv9) )
# include <boost/detail/sp_counted_base_gcc_sparc.hpp>
Test results follow.
Michael
[michael_at_hawk test]$ LD_LIBRARY_PATH=/usr/local/lib timex
./shared_ptr_mt_test_v8
Using POSIX threads: 16 threads, 1048576 iterations:
30.880 seconds.
real 16.01
user 29.38
sys 1.52
[michael_at_hawk test]$ LD_LIBRARY_PATH=/usr/local/lib timex ./weak_ptr_mt_test_v8
Using POSIX threads: 16 threads, 16384 * 512 iterations:
379813 locks, 181731 forced rebinds, 8025179 normal rebinds.
371551 locks, 177624 forced rebinds, 8033441 normal rebinds.
374752 locks, 178872 forced rebinds, 8030240 normal rebinds.
383374 locks, 183838 forced rebinds, 8021618 normal rebinds.
380078 locks, 181728 forced rebinds, 8024914 normal rebinds.
382020 locks, 182268 forced rebinds, 8022972 normal rebinds.
369253 locks, 176284 forced rebinds, 8035739 normal rebinds.
393058 locks, 187938 forced rebinds, 8011934 normal rebinds.
382446 locks, 183078 forced rebinds, 8022546 normal rebinds.
375525 locks, 179473 forced rebinds, 8029467 normal rebinds.
400324 locks, 191431 forced rebinds, 8004668 normal rebinds.
386603 locks, 185354 forced rebinds, 8018389 normal rebinds.
371274 locks, 177531 forced rebinds, 8033718 normal rebinds.
373879 locks, 178946 forced rebinds, 8031113 normal rebinds.
413007 locks, 197973 forced rebinds, 7991985 normal rebinds.
397481 locks, 191423 forced rebinds, 8007511 normal rebinds.
56.960 seconds.
real 29.46
user 56.95
sys 0.03
[michael_at_hawk test]$ LD_LIBRARY_PATH=/usr/local/lib/sparcv9 timex
./shared_ptr_mt_test_v9
Using POSIX threads: 16 threads, 1048576 iterations:
29.900 seconds.
real 16.11
user 27.08
sys 2.83
[michael_at_hawk test]$ LD_LIBRARY_PATH=/usr/local/lib/sparcv9 timex
./weak_ptr_mt_test_v9
Using POSIX threads: 16 threads, 16384 * 512 iterations:
374408 locks, 179259 forced rebinds, 8030584 normal rebinds.
373631 locks, 178540 forced rebinds, 8031361 normal rebinds.
366733 locks, 175164 forced rebinds, 8038259 normal rebinds.
365186 locks, 174167 forced rebinds, 8039806 normal rebinds.
371817 locks, 178056 forced rebinds, 8033175 normal rebinds.
388075 locks, 186092 forced rebinds, 8016917 normal rebinds.
380838 locks, 181954 forced rebinds, 8024154 normal rebinds.
364328 locks, 174298 forced rebinds, 8040664 normal rebinds.
360716 locks, 172291 forced rebinds, 8044276 normal rebinds.
359705 locks, 171985 forced rebinds, 8045287 normal rebinds.
374523 locks, 179275 forced rebinds, 8030469 normal rebinds.
381814 locks, 182852 forced rebinds, 8023178 normal rebinds.
380550 locks, 182078 forced rebinds, 8024442 normal rebinds.
375862 locks, 179565 forced rebinds, 8029130 normal rebinds.
351562 locks, 167660 forced rebinds, 8053430 normal rebinds.
398814 locks, 191018 forced rebinds, 8006178 normal rebinds.
38.000 seconds.
real 19.21
user 38.01
sys 0.01
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk