This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Re: mutex and mailbox query
- From: Savin Zlobec <savin at torina dot fe dot uni-lj dot si>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: <hans dot doran at ibhdoran dot com>, <ecos-discuss at sources dot redhat dot com>
- Date: Sat, 20 Sep 2003 23:46:32 +0200 (CEST)
- Subject: Re: [ECOS] 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