multithreading

56 views
Skip to first unread message

Tim Lenertz

unread,
Apr 22, 2016, 6:39:50 AM4/22/16
to CATCH
I'm creating one or multiple separate threads inside a SECTION, and running REQUIRE tests inside the threads. Is this supported by Catch? The threads don't outlive the SECTIONs (i.e. are joined at the end of the SECTION).

Currently I'm getting "double free or corruption" errors on the tests, which seem to occur from the REQUIRE calls inside the separate threads.

If it is not supported, is it safe to run separate threads inside SECTIONs, but use REQUIRE only from the main thread?

I'm using Catch v1.3.4.

Phil Nash

unread,
Apr 23, 2016, 8:29:33 AM4/23/16
to CATCH
Catch is not currently thread safe (which explains your errors).
It should be safe run threads within a section - as long as the REQUIREs - or any other Catch macro - are only called from a single thread at a time (doesn't have to be the main thread).

I'm working on threading support for Catch v2!
Reply all
Reply to author
Forward
0 new messages