This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Condition Variables w/o mutual exclusion?


On Wed, Oct 03, 2001 at 12:15:13PM +0100, Hugo Tyson wrote:
> 
> Grant Edwards <grante@visi.com> writes:

> > I need a mechanism for one or more threads to block until an
> > event happens inside a DSR.  Something like a flag bit would be
> > perfect, but according to the table at
> > http://sources.redhat.com/ecos/docs-latest/ref/ecos-ref.13.html#pgfId=1080419
> > condition variables are the only mechanism usable from a DSR.
> 
> It's lying ;-(     As Jifl says, perhaps based on dogma ;-)
> 
> You can indeed use a flag object - again, so long as you only
> do operations which cannot block within the DSR.
> 
> Beware though that a flag "setbits" has broadcast semantics
> (which is what you want), so it will take time - perhaps a lot
> of time - proportional to the number of threads that were
> waiting.  *That*'s the reason using this primitive in a DSR
> might be recommended against.

Setbits won't take any longer than a cond_broadcast for a given
number of waiting threads, will it?  In my applications there's
only one, but I don't want to limit it in case others want to
have multiple waiting threads.

-- 
Grant Edwards
grante@visi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]