Process States - aryanjoshi0823/5143-Operating-System GitHub Wiki
A process in an operating system transitions through various states during its lifecycle, from creation to completion. The minimum number of states is five, though some models may include additional states.
Process States:
1. New
- A program that is ready to be picked up by the OS and loaded into the main memory is in the new state.
2. Ready
- Once created, a process enters the ready state, waiting for CPU allocation.
- These processes are loaded into the main memory from the secondary memory.
- The ready state may contain multiple processes, depending on the system.
3. Running
- From the ready state, the OS selects one process (based on the scheduling algorithm) to execute.
- If the system has one CPU, only one process will be in the running state at any given time.
- In systems with multiple CPUs,
n
processes can run simultaneously.
4. Blocked/Wait
- A process transitions to the blocked or wait state when it needs a resource or input to proceed.
- During this time, the CPU is reassigned to another process.
5. Completion/Termination
- A process enters the termination state after finishing execution.
- The OS removes the process from the system and deletes its Process Control Block (PCB).
6. Suspend Ready
- When resources (like primary memory) are insufficient, a ready process may be moved to secondary memory, entering the suspend ready state.
- These processes wait in secondary memory until main memory becomes available.
7. Suspend Wait
- A blocked process may be moved to secondary memory, entering the suspend wait state.
- This makes room for higher-priority processes in the main memory.
- The process returns to the ready state once its wait is over and memory becomes available.