Loading a page, please wait a second.
If you couldn't get a page in short time, click me, you can get it directly
User Pass

The latest photos...

The latest news...
Linux Magazine
Dell Studio 1747 Laptop: One Fatal Flaw Away from Linux Perfection
The State of Oracle/Sun Grid Engine
Monitoring Android Events
Dropbox: Painless and Free Backup
Debian at 17: As Important as Ever
Bcache Testing: Throughput
A Cluster In Your Pocket
Wiring Up Android Buttons
Virtualization Through Thick and Thin
The State of Open Source System Automation

LWN.net
Morgan: Finding more women to speak at Ohio LinuxFest: success!
Embedded Linux Conference videos available
Thursday's security updates
Vignatti: X Census (for 1.9)
[$] LWN.net Weekly Edition for September 2, 2010
Welte: More GPL enforcement work again.. and a very surreal but important case
GNOME Journal Issue 21 released
Security advisories for Wednesday
Duffy: A story about updates and people
[$] LinuxCon Brazil: QA with Linus and Andrew
Debian Project mourns the loss of Frans Pop
PostgreSQL 9.0 Release Candidate 1
KDE SC 4.5.1 Released
Tuesday's security updates
[$] A licensing change for syslog-ng

Linux Gazette
Mailbag
2-Cent Tips
News Bytes
Video editing from the command line
Away Mission: VMworld, IDF, OOW
Henry's Techno-Musings: Hotmail Change Prompts Switch to Linux
Almost-but-not-quite Linux...
Common problems when trying to install Windows on KVM with virt-manager
HelpDex
Ecol
Doomed to Obscurity
The Linux Launderette
Communications of the ACM: Latest Issue
Expanding CS Education; Improving Software Development
Erlang
Confronting the Myth of Rapid Obsolescence in Computing Research
Principles of the Law of Software Contracts
Objects Never? Well, Hardly Ever!
More Than One Way to Annotate Metadata
Return at Risk
Performance Evaluation and Model Checking Join Forces
Little Brother Is Watching
Puzzled: Solutions and Sources
More Communications
Kyoto Prize and Other CS Awards
ACM China Nearing Launch
Cycling Through Data
Degrees, Distance, and Dollars
Brains and Bytes
Future Internet Architecture: Clean-Slate Versus Evolutionary Research
Injecting Errors for Fun and Profit
Computers in Patient Care: The Promise and the Challenge
Thinking Clearly About Performance, Part 1
Constraint Satisfaction Problems and Global Cardinality Constraints
Privacy Integrated Queries
Programming With Differential Privacy
Constraint Satisfaction Problems and Computational Complexity
Science Has Only Two Legs
Discussing Cyber Attack

Thought what I have
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]

 Commented by 박성제 at 2010-09-01 09:22:31
I added 2 APIs for handling this. register_irq, unregister_irq. using this two API, device driver can take the interrupt of device. TTY device driver will register their own callback for handling the keyboard IRQ. and in that function, TTY will collect the input data to its own buffer. if the user requires data from the TTY, then the TTY device driver will push the buffer'd input data to the user through the "read" operation of the character device driver. ;) and I will add two more API. it would be the kthread_sleep_for_io, kthread_wakeup_for_io. if the TTY has not enough data it will move the requestor(thread) to the io waiting thread,. then the task(or thread whatever else) scheduler will not choose that task(or thread) to make it run. it means that task will be blocked while has no input. x


User  Pass   Webpage 
Write (1718033881) to key entry : Key 





Neighbor blogger

Total: 109115
Today: 6

사용자
Total 9, Now 0

Web-log
[38.107.191.106]x1
[61.111.246.56]x2
[67.195.115.223]x1

Collector-log
[209.85.238.120]x1
[61.111.246.56]x1
[209.85.238.120]x1

Quick link



Elapsed time for generating this page is 0 sec 27319 msec
Copyright 2005-2010, sjpark All right reserved.