What you say would be true if the computer were processing and excuting one process and one process only.
The example that you use would be more appropriate for a finite state machine than a multitasking OS.
A multitasking OS is more like a busy train lobby with processes entering, operating and exiting. Each customer entering the lobby can be viewed as a task or process which enters the CPU (task starting), does a function (task running), and then exits (task ending)
All of the taks communicate with a central operating kernel, which, among other things, is responsible for the modules and tasks that are running.
One of the ways that the kernel knows that the task are running correctly is by a mechanism known as a "watchdog timer". The purpose of the watchdog is to ensure that tasks and modules "check in" with the kernel.
If a module (for whatever reason) fails to check in, the kernel may take action to restart the module, or in some cases, kill the module.
Sometimes the result of killing the module is an unrecoverable error from which the kernel has no other option but to shut down the system.
Modules or processes can encounter problems for any number of reasons.
Memory access problems (corruption or invalid address)
Zombie process (process gets into a loop and doesn't respond)
Memory leak (memory not properly released as processes start and stop)
Instruction Exception (an abnormal condition which may be caused by poorly written software or an unexpected condition)
Others can probably elaborate or add to this list.
This message has been edited since posting. Last time this message was edited on 29. July 2009 @ 18:02
|