sp_atomic_mt2_test: a test for mutex/shared_mutex/atomic access performance

I've added sp_atomic_mt2_test.cpp: http://svn.boost.org/trac/boost/browser/trunk/libs/smart_ptr/test/sp_atomic_... to the SVN; this is a reader/writer performance test that can be used to compare the performance of a detail::lightweight_mutex, boost::shared_mutex and the new atomic access operations for shared_ptr. It accepts command line options that can be used to achieve a variety of scenarios. I'm currently seeing a plain mutex (maps to a CRITICAL_SECTION) outperforming shared_mutex for the default configuration of read/write ratio 100:1, vector size (operation cost) 10000, no matter how many threads I use on a dual CPU box on Windows. This seems somewhat suspicious and may indicate a bug in the test. Any comments are welcome. :-)
participants (1)
-
Peter Dimov