Boost logo

Boost Users :

Subject: Re: [Boost-users] condition_variable
From: Alessandro Bellina (abellina_at_[hidden])
Date: 2009-12-10 12:38:36


I get an assertion failed error... but I don't know if that would help:

"_Pvector == NULL || (((_Myvec *)_Pvector)->_Myfirst <= _Ptr && _Ptr <=
((_Myvec *)_Pvector->_Mylast)" and soon after everything blows up.

Here's a thought.. suppose that the thread receiving the response (so the
one that calls notify_one), locks the mutex multiple times (without
notifying every time)...

like this:

boost::mutex::scoped_lock lock( mutex );

if( response == "something I care about" )
{
       lock.unlock();
       condition.notify_one();
}

and multiple responses did come through. What would the effects be in the
condition variable?

Why is it that since we already hold a mutex in the requesting thread, the
thread handling the response can successfully lock that mutex too? Does the
condition.wait call set something in the lock?

Thanks,

Alessandro

On Wed, Dec 9, 2009 at 9:28 AM, Steven Watanabe <watanabesj_at_[hidden]>wrote:

> AMDG
>
>
> Alessandro Bellina wrote:
>
>> I am using boost condition_variables to block while waiting for an
>> asynchronous response. I am seeing an error that happens at random
>> whenever
>> I am releasing the lock just before calling notify_one. The error goes
>> away
>> if I keep the lock and release after notify_one.
>>
>>
>
> What error do you get?
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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