A process is a running instance of a program. The Operating System manages processes by performing various operations on them during their lifecycle.
1. Process Creation
Example: Opening a browser creates a new browser process.
OS actions:
-
Assign a unique Process ID (PID)
-
Allocate memory
-
Initialize PCB (Process Control Block)
-
Load program code into memory
-
Add the process to the ready queue
2. Process Scheduling
-
The OS schedules processes using a scheduler.
-
It selects one of the ready processes for CPU execution.
-
Uses algorithms like FCFS, Round Robin, Priority Scheduling, etc.
OS actions:
-
Dispatch the selected process
-
Load its context (CPU registers, program counter)
-
Start or resume execution
3. Process Switching (Context Switching)
OS actions:
4. Process Suspension and Resumption
OS actions:
5. Process Termination
OS actions:
Example: Closing a game ends its process and frees up RAM.
6. Inter-Process Communication (IPC)
OS actions: