
If you define BOOST_SP_DISABLE_THREADS class boost::detail::sp_counted_base doesn't use a mutex (see http://www.boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety). However boost::detail::quick_allocator still uses a mutex as it checks BOOST_HAS_THREADS but not BOOST_SP_DISABLE_THREADS (see http://www.boost.org/boost/detail/quick_allocator.hpp). Is this intentional (as quick_allocator might be used by other classes)? Boris

"Peter Dimov" <pdimov@mmltd.net>, news:003401c66084$5558a460$6407a8c0@pdimov2...
Let's see. :-) Where does BOOST_HAS_THREADS come from? I see a source code comment in /boost/config/win32.hpp (I'm on Windows) mentioning BOOST_HAS_THREADS but no definition? But after having glanced over /boost/config/user.hpp the right thing is probably to define BOOST_DISABLE_THREADS to get rid of all synchronization? Boris

Boris wrote:
BOOST_HAS_THREADS is defined automatically when _MT is defined; most Windows compilers define _MT when their multithreaded runtime library is selected.
Yes, this would work. BOOST_DISABLE_THREADS is a user macro that causes BOOST_HAS_THREADS to not be defined, regardless of whether the platform is detected to support multiple threads. The configuration macros are described in http://www.boost.org/libs/config/config.htm
participants (2)
-
Boris
-
Peter Dimov