|
Boost Users : |
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2008-01-10 16:45:06
On Jan 10, 2008 8:48 PM, Gennadiy Rozental <rogeeff_at_[hidden]> wrote:
> Ovanes Markarian <om_boost <at> keywallet.com> writes:
> > struct thread_safety_test
> > {
> > static void thread_function(boost::barrier& b)
> > {
> > b.wait();
>
> Can't comment in these. I never used this class.
>
> | boost::mutex::scoped_lock lock(m);
> | BOOST_CHECK_EQUAL(1,0);
> | }
> |
> | void test_multiple_assertion_faults()
> | {
> | boost::thread_group tg;
> | boost::barrier b(100);
> |
> | for(size_t i=0; i<100; ++i)
> | {
> | tg.create_thread(boost::bind(thread_function, ref(b)));
> | }
> | }
> | };
> | But unfortunately this does not work. May be I miss smth. here.
>
> >I am not an expert in MT, but what exactly is the problem?
> >
> >Do you run is from inside the test case?
>
>
> Yes. The class specified is passed to the BOOST_CLASS_TEST_CASE(
> multiple_assertion_faults, thread_safety_test)
>
> The idea of my code is:
> Create 100 threads and wait until all of them are created. (barrier is
> used for that).
>
> After all threads were created lock the mutex and produce the assertion
> fault. In MSVC 7.1 this code crashes after the second call to
> BOOST_CHECK_EQUAL.
>
>
> I thought you would be aware of this issue.
>
>
> Many thanks for your help!
> Ovanes
>
>
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net