[ECOS] Re: Waiting I/O operation

Sergei Gavrikov w3sg@SoftHome.net
Thu Jul 19 10:47:00 GMT 2007


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



More information about the Ecos-discuss mailing list