23 Mar
2010
23 Mar
'10
8:28 p.m.
Guys, I've just noticed BOOST_MESSAGE is not thread safe instruction. It is unbelievable!! I do not want to believe it!!! Try this: #define BOOST_TEST_MAIN #include <boost/test/unit_test.hpp> #include <boost/thread/thread.hpp> void foo() { for( size_t i = 0; i < 100000000; ++i ) { BOOST_MESSAGE( "111111122222222223333333333" ); } } BOOST_AUTO_TEST_CASE( testBoost ) { size_t const SIZE = 2; boost::thread t[ SIZE ]; for( size_t i = 0; i < SIZE; ++i ) { t[ i ] = boost::thread( &foo ); } for( size_t i = 0; i < SIZE; ++i ) { t[ i ].join(); } } windows XP SP3 32bit VS 2008 SP1 boost 1.42 -- Dmytro Ovdiienko