[Test] Can Boost Test Tools Be Used in Multiple Threads?
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? Cheers, Freddie -- Wu Yinghui, Freddie Research & Development Software Engineer Volume Interactions Pte Ltd 1 Kim Seng Promenade, #12-01 Great World City East Tower Singapore 237994 Tel: +65 62226962 (Ext 216) Fax: +65 62226215 Email: yhwu@volumeinteractions.com URL: http://www.volumeinteractions.com Important: This message is intended for the recipient(s) addressed above. It contains privileged and confidential information. If you are not the intended recipient, please notify the sender immediately by replying to this message and then delete it from your system. You must not read, copy, use, or disseminate this communication in any form. Thank you.
"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
On Fri, 02 Jun 2006 18:08:25 -0300, Gennadiy Rozental
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.
What exactly does this mean? Bruno
"Bruno Martínez"
On Fri, 02 Jun 2006 18:08:25 -0300, Gennadiy Rozental
wrote: 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.
What exactly does this mean?
The usual. You could reenter framework functions (for example you could create and run test case dynamically from inside another test case). But you couldn't access test tools from different threads. Gennadiy
participants (3)
-
Bruno Martínez
-
Gennadiy Rozental
-
Wu Yinghui, Freddie