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]
Other format: [Raw text]

Re: Re: mutex and mailbox query


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


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