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]

gets() and task scheduling stopped


Hi,

A few days ago I wrote:
>> …
>> I found another problem related to keyboard when using gets().
>> I read in previous messages, support for keyboard works by doing polling,
but I do not explain why when gets() is >> called by one thread, all other
threads stop running...
>
>I don't think it should be all threads. But it probably will be all threads
>of lower priority - the fact it polls means it is in a busy loop, so lower
>priority threads can't run. A proper interrupt driven driver needs to be
>written for that.
>
>Jifl

I tried to use gdb to get more details and also verified that the thread
which call gets() do not let other threads run whatever is their priority,
higher, lower or same.
My test is done as follow: I start a few threads, then the threads which
call gets(). This gets() is used to enter a simple commands which display
the status of other threads and the value of an incrementing counter in
these other threads (which is all they are doing in a loop). I then verify
that these counters are not incrementing until I return from gets().

So if my test is not bugged, it seems the scheduler is locked in the gets()
and waiting for characters to be input.
Only when I press return, it get out of the gets() and other task run until
I enter again in gets().
This is really bad because there is no way to get any input from keyboard
and have at same time other threads running, unless somebody knows a way to
go around this ?
For what I understand with gdb it seems to be stuck at the bottom of this
sequence of calls gets() -> refill_…() -> read() -> readwrite() ->
dev_fo_read() -> cyg_io_read() -> tty_read() ->cyg_io_read() ->
serial_read() -> haldiag_getc() -> HAL_DIAG_READ->…
The scheduler is locked at many levels in the previous calls. I was also
looking at a loop in tty_read() which is done after a lock… but I do not
catch all the details of this low level code.
I updated with the latest CVS to be sure it was not another problem.
Has anybody else experienced gets() in multithreaded environment ?

Sam.

-- 

_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


1 cent a minute calls anywhere in the U.S.!

http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com


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