Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-02-16 13:59:26

I have added two more shared_ptr tests in libs/smart_ptr.

shared_ptr_timing_test.cpp can be used to evaluate the performance of the
thread safe implementation relative to the single-threaded baseline
(-DBOOST_DISABLE_THREADS disables shared_ptr thread safety.)

shared_ptr_mt_test.cpp tests the thread safety. Currently it passes for me
on MSVC 7 and Borland 5.5.1 on Windows and g++ 2.96 on Linux (both machines
have a single processor, though.) Unfortunately I get strange errors with
g++/mingw on Windows; when I force shared_ptr to use a CRITICAL_SECTION
via -DBOOST_LWM_WIN32_USE_CRITICAL_SECTION, the problems go away, leading me
to think that the InterlockedExchange "optimized" mutex is either a bit
overoptimized, or I've done something wrong.

Any insights, or results from multiprocessor machines or different
compilers, are appreciated.

Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at, gregod at, cpdaniel at, john at