Process state diagram- Initially the process is in new state i.e the process is under creation. Once the process is created it will move to ready state. In ready state, there are multiple process, there we will select/process and schedule/dispatch it to run state. In running state, process will execute instruction. In running state, there is only one process at a time. Once process completes the execution, the process will move to termination/complete state. If the process requires IO operation, the process will move to wait state or block state. In wait state, the process will perform IO operation. Once IO operation is completed, it moves to ready state.
(Why not running because of some other process)?- In ready state we have multiple process. In wait state we can also have multiple process i.e multiple process can perform IO operation simultaneously.
*when process is in ready state or running state or wait state, the process is in main memory.
Multiprogramming-
- Non preemptive- following is a process state program i.e we are not disturbing the running process until it is completed.
- Preemptive or multitasking or time sharing- we are disturbing the running process forcefully.
when the time quantum (2s) expires, then we preempt the running process(P1) by (P2). This is also how we can disturb the running process.
]]>