This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Re: Waiting I/O operation
- From: Sergei Gavrikov <w3sg at SoftHome dot net>
- To: Alexey Shusharin <mrfinch at mail dot ru>
- Cc: cetoni GmbH - Uwe Kindler <uwe dot kindler at cetoni dot de>, ecos-discuss at sourceware dot org
- Date: Thu, 19 Jul 2007 13:47:05 +0300
- Subject: Re: [ECOS] Re: Waiting I/O operation
- References: <469F24AE.9060907@cetoni.de> <469F3371.2000204@mail.ru>
Alexey Shusharin writes:
> cetoni GmbH - Uwe Kindler wrote:
> > In my opinion you should go with the second thread solution.
>
> Maybe. But in this variant I have a delay in receiving messages and
> useless processor working. :-( It seems that it will be better if I
> donate a memory for the second thread.
>
> > I don't know if it is allowed to use flags from within DSRs but I
> > believe you can not use them and then also a callback solution would not
> > solve your problem. Your callback would need to wakup a "service thread"
> > that would signal the flag to the waiting thread - but then you would
> > also need two threads.
>
> Why I can't use flags in DSR?
> I think, I can't wait in DSR but I'm able to use cyg_flag_setbits() for
> wake-up thread. And my thread will call cyg_flag_wait() for waiting this
> and some other flags.
> Regards,
> Alexey
According the eCos reference manual (Synchronization Levels), they do
tell us that the synchro things are suitable for the DSRs are the
cyg_drv_cond_signal() and cyg_drv_cond_broadcast() only. The thread's
deal is to wait a condition using cyg_drv_cond_wait().
But, one my today DSR uses the cyg_flag_setbits() notifier and that
works as I could expect. I found that is more simple, because that
doesn't need itself in a mutex. I wonder about the right hacking from
the eCos experts.
Sergei
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss