Boost logo

Boost :

From: Lars Gullik Bjønnes (larsbj_at_[hidden])
Date: 2002-05-15 08:14:50


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

| From: "Lars Gullik Bjønnes" <larsbj_at_[hidden]>
>>
>> Something like this might work for gcc.
>> I have not tested it, especially the use of __exchange_and_add must be
>> revised.
>> If something like this is added the lwm_linux.hpp can probably just be
>> removed.
>
| Does shared_ptr_mt_test.cpp work? It's not a comprehensive test; still, it's
| better than nothing.

[larsbj_at_trylle smart_ptr]$ g++ -O2 -Wall -W -I/home/larsbj/Development/boost -o shared_ptr_mt_test shared_ptr_mt_test.cpp -lpthread
In file included from /home/larsbj/Development/boost/boost/detail/lightweight_mutex.hpp:51,
                 from /home/larsbj/Development/boost/boost/detail/shared_count.hpp:26,
                 from /home/larsbj/Development/boost/boost/shared_ptr.hpp:27,
                 from shared_ptr_mt_test.cpp:19:
/home/larsbj/Development/boost/boost/detail/lwm_gcc.hpp:28:2: warning:
#warning Using gcc atomicity.h

[I added this to be sure that the atomicity.h files was actually
used.]

[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.

-- 
	Lgb

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