DOS Program model:
DOS programs call the operating system to get the input directly.
Whenever a DOS application starts complete control over the system resources like CPU, memory is given to it.
The DOS application waits for the user to input, then it takes a particular action.
Internally as it waits, it continues controlling the system resources and the control is not given to any other applications till the current application is closed.
Whenever an I/O (input output) event occurs, the information goes directly to the application but not to the operating system.
Windows Program model:
Where as windows programs process the input with the help of messages sent by the operating system.
Windows is responsible for all I/O events like mouse clicks, keystrokes etc…
When an event is generated windows figures out which window application is currently active and sends the information about the event to the current or active application.
The below figure shows that:
In other words, all messages that event is generated is stored in the form of a queue called system queue, which is maintained by windows.
From the system queue, the messages are then sent to applications by windows and stored in appropriate application message queues.
It is the responsibility of the applications to read the queue and process the messages.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment