
"Wu Yinghui, Freddie"
wrote in message news:447FA165.5040008@volumeinteractions.com... Dear all, I've been trying to write some test code that involves 2 concurrent threads of execution. But I found that there are occasional crashes in the test tool code when some BOOST_CHECK_*() are triggered.
So my question is: Are Boost test tools designed to be used in multiple threads?
Short answer - no. The test framework is reentrant, but not thread safe. This is a conscious decision. At the moment I do not know the best API to use for critical section guarding. Your best bet would be to wrap Boost.Test tools with your own that does invoke guards. Also you could make sure somehow that all test tools invoked from single thread. Or... you could present solution that would incorporate fix into test framework. Gennadiy