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: Help with Interrupt driven Serial ports in EB40A


> Hi,
>    Thanks for the reply. That helps. I want it
> Interrupt driven as I want to do some other work when
> there is no data from the serial port. So can I have 2
> threads, one for reading from the serial port and the
> other doing some other work? Won't the read call in
> the first thread block the entire execution?
> Can you please help me on this.

Yes, you can use two threads, one of which is reading and blocking on the
serial port. That is actually the whole point of using multithreading in
event-driven predominantly I/O based real time systems. The read call will
only block the execution of the thread from which it was called, meaning
that the other thread(s) will then be able to be run by the scheduler,
assuming of course that they are not doing blocking operations themselves.

Robert Cragie, Design Engineer
_______________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
http://www.jennic.com  Tel: +44 (0) 114 281 2655
_______________________________________________________________


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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