4:31 Aug 30 posted message: Input handling between several threads which are waiting inputs.
What happens if several threads are waiting the keyboard input?
in shortly, two threads are invoking the "scanf" function, then how they get the keyboard data?
of course, those two threads are shares one console(tty).
ah...
While writing this article, I can re-arrange my thought and maybe I can find the answer of handling the inputs. :D
Kernel just push the input data to current task which grabs a console's standard I/O.
and before the first thread release the input, the second thread will be blocked.
so I will add the second one to the I/O waiting list, and the first one will get the input data from the ISR.
Okay.
Then, how about this?
If two or more tasks(or threads) are waiting the input data from the keyboard,. then the kernel spreads input data to all waiting tasks.
what happens if I implement like this???
hehe...
Just I need to imagine the future of this theory,.
maybe all processes will be go into the hell.. if I spread all input data to all tasks which are waiting the inputs...
;)
today is so tired to me..
I'm very sleepy now, but I'm happy, because I solved big problem... and find the way to solving new problems... ;D
I should to go bed now.. aham....
C U...
Track-back URL : http://nicesj.com/trackback.php?table_name=blog&tid=984
Article URL : http://nicesj.com/?tid=984
[List]