This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Waiting I/O operation
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Alexey Shusharin <mrfinch at mail dot ru>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Fri, 20 Jul 2007 21:31:02 +0200
- Subject: Re: [ECOS] Waiting I/O operation
- References: <469EFC48.2060602@mail.ru>
On Thu, Jul 19, 2007 at 12:53:12PM +0700, Alexey Shusharin wrote:
> Hello all,
>
> My eCos application works with CAN I/O driver and has one thread for
> processing CAN messages. I call cyg_io_read() and thread start waiting
> incoming message. This situation is clear.
>
> However I've decided to add other functionality to the thread therefore it
> should wait not only I/O operation (for ex: some event flags). Now I have
> these variants:
>
> 1. Create a second thread :-(
> 2. Make non-blocking read with a small time interval :-((
> 3. Add a callback functionality to CAN I/O driver and wake-up the thread in
> callback function then message is coming
Threads in eCos are light weight. So 1) is the preferred option.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss