Boost logo

Boost Users :

From: Manuel Jung (gzahl_at_[hidden])
Date: 2007-03-06 12:10:52


Gottlob Frege wrote:

> On 3/5/07, Manuel Jung <gzahl_at_[hidden]> wrote:
>> Hi,
>>
>> I would like to know the waiting threads for a condition. Is there a way
>> to calculate the number of "wait()"s which would be affected by a
>> notifiy_all()?
>> Maybe nobody needed this before? Or isn't this possible to implement such
>> a thing with boost::condition and i have to count the waiting threads on
>> the application level?
>>
>
> When would this be useful? Note that as soon as you had that info, it
> would be out of date:

Hi,
It wouldnt matter, if its not exact. it is just for monitoring, so i can
watch how many threads a waiting approximatly.
>
> int count = condition.number_of_waiters(); // eg: returns 5
> // ...another thread starts waiting here
> condition.notify_all(); // and 6
> threads 'notified'

Ill use a "boost::condition::wait" wrapper to count it.

Bye
Manuel Jung


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