[ECOS] Re: mutex and mailbox query

Savin Zlobec savin@torina.fe.uni-lj.si
Sat Sep 20 21:48:00 GMT 2003


On Sat, 20 Sep 2003, Andrew Lunn wrote:

> > > Problem is, you have no way of knowing if any threads are waiting on
> > > the mbox or the mutex. There are no API calls to tell you this.
> >
> > Yes, the following scenario limits the usage of mbox to cyg_mbox_tryget,
> > or maybe the cyg_thread_release could be used.
>
> Don't forget that cyg_mbox_put will also block, so you also have to do
> a tryput.

I just looked from one side :-)

> cyg_thread_release is no use, you don't know which threads to
> release!

There should be some aditional logic in the application to use
cyg_thread_release. Maybe it would be better to use a conditional
variable and implement the messaging based on it. That way some
aditional info about the message queue could be passed between
threads.

savin


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list