[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ost::Event and multiple wait()s
From: |
Daniel E Baumann |
Subject: |
Re: ost::Event and multiple wait()s |
Date: |
Thu, 14 Nov 2002 21:20:33 -0600 |
User-agent: |
Mutt/1.4i |
OK, yea, the devil is in the details ;). Hmm, alright but with a
Conditional I need to still use a Mutex to prevent the infinite wait
problem right? Which Event takes care of for me. You think it would be
wise to change the signal method of Event to take a boolean to
determine whether someone wants broadcast or not? I sorta of see Event
as encapslating both a condition variable and the atomic (locked with
a mutex) conditional test.
On Wed, Nov 13, 2002 at 10:38:50PM +0100, Federico Montesino Pouzols wrote:
>
> If you want only one thread to be picked, I think Event will
> not work. Event::signal uses pthread_cond_broadcast, so all waiting
> threads will be reactivated. Conditional however has a signal method
> that allows to specify whether to use pthread_cond_broadcast or
> pthread_cond_signal.
>
> On Mon, Nov 11, 2002 at 07:14:22AM -0600, Daniel E Baumann wrote:
> > I was just wondering if it is possible for multiple threads to wait on
> > an Event and for it to pick one of them to run when calling
> > signal(). Looks to me that it is possible becase it uses a condition
> > variable. I just wanted to confirm this. I need to write a boolean
> > lock class and would like this capability.
> >
> > Dan
> > --
> > And if cynics ridicule freedom, ridicule community...if ``hard nosed
> > realists'' say that profit is the only ideal...just ignore them, and use
> > copyleft all the same.
> > -- RMS
> >
> > Was I helpful? Let others know:
> > http://svcs.affero.net/rm.php?r=chillywilly
> >
> >
> > _______________________________________________
> > Bug-commoncpp mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>
--
And if cynics ridicule freedom, ridicule community...if ``hard nosed
realists'' say that profit is the only ideal...just ignore them, and use
copyleft all the same.
-- RMS
Was I helpful? Let others know:
http://svcs.affero.net/rm.php?r=chillywilly