Boost logo

Boost :

From: Eugene Prystupa (prystupa_at_[hidden])
Date: 2006-11-28 20:12:28


Peter,

> Why do you want to atomically pulse a condvar and acquire a mutex? What do
> you mean by pulse, and what do you have in mind when you say "atomically"
> in
> this context? If you acquire the mutex first, then notify/broadcast, how
> could your threads detect the non-atomicity of these two actions, and why
> are they able to?

To be precise I want to notify/broadcast one condition variable and
simultaneously (atomically) start waiting on another condition variable. If
I simply notify the first condition variable (and wake thread A) and then
start waiting on the second condition variable (in thread B), chances are
thread A may notify on the first condition before thread B starts waiting on
it.
P.S. I accidentally mentioned "acquiring mutex" because condition variable
usage is paired with mutex in boost design.

Thanks,
Eugene

"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:008d01c712e9$59aa6e50$6607a8c0_at_pdimov2...
> Eugene Prystupa wrote:
>> I'm trying to find a way to atomically pulse a condition variable and
>> acquire a mutex, something I get used to in the .Net world. It
>> doesn't seem that this operation exists in boost/thread. Anyone has
>> done this with boost? Thanks, Eugene
>
> Why do you want to atomically pulse a condvar and acquire a mutex? What do
> you mean by pulse, and what do you have in mind when you say "atomically"
> in
> this context? If you acquire the mutex first, then notify/broadcast, how
> could your threads detect the non-atomicity of these two actions, and why
> are they able to?
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk