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]

Re: select err in ecos application


"wangwei" <wangw@start.com.cn> writes:

> Hi all:
> 
> I'm making a application in ecos , which will drive 8 serial ports and
> tcp/ip.
> I use function "select" in my program .To improve speed , I use ISR of
> serial port
> to receive data , not DSR. So the functon "cyg_selwakeup" is called in ISR .

You just cannot do that. There is no guarantee that the state of the
kernel run queues, the condition variable or the mutex involved will
be consistent. Applying any operation to them in an ISR is very
likely to corrupt something. Which is exactly what is happening to
you.

Instead, you should move the call to cyg_selwakeup() to the DSR and
have the ISR return the RUN_DSR bit only when it needs to be called.


-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK


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