Operating System
Process Management
Process Management is one of the core responsibilities of an Operating System. A process is simply a program that is currently being executed. The operating system manages multiple processes efficiently so that users can run several applications simultaneously without conflicts.
Whenever you open a browser, play music, edit documents, or run games, the operating system creates and manages processes for each task.
What is a Process?
- A process is an instance of a program in execution.
- It contains program code, data, stack, registers, and memory allocated during execution.
- Multiple processes can exist for the same program.
- Each process has its own Process ID (PID).
Process Memory Layout
Process States
During execution, a process moves through different states depending on CPU availability and execution status.
- New: Process is being created.
- Ready: Process is waiting for CPU allocation.
- Running: Instructions are currently executing.
- Waiting: Process waits for I/O or events.
- Terminated: Process execution is completed.
Process Control Block (PCB)
The Process Control Block is a data structure maintained by the operating system for every process.
| PCB Component | Purpose |
|---|---|
| Process ID | Unique identification number |
| Process State | Current status of process |
| Program Counter | Address of next instruction |
| CPU Registers | Stores register information |
| Memory Information | Details about allocated memory |
Process Scheduling
Process scheduling determines which process gets CPU time. The scheduler ensures efficient CPU utilization and fairness.
- Long-Term Scheduler: Selects processes from job pool.
- Short-Term Scheduler: Chooses process for CPU execution.
- Medium-Term Scheduler: Handles swapping processes.
Context Switching
Context switching occurs when the CPU switches from one process to another. The operating system saves the current process state and loads the next process state.
- Save current process state
- Store PCB information
- Select next process
- Load next process state
- Resume execution
Threads
A thread is the smallest unit of CPU execution within a process. Multiple threads can exist inside a single process.
- Threads share memory and resources of the same process.
- Threads improve responsiveness and performance.
- Examples include browser tabs and multiplayer games.
Advantages of Process Management
- Efficient CPU utilization
- Supports multitasking
- Improves system responsiveness
- Allows concurrent execution
- Provides better resource sharing
Summary
Process Management is responsible for creating, scheduling, executing, and terminating processes efficiently. It ensures smooth multitasking, proper CPU utilization, and effective resource sharing in modern operating systems.
Ready to test your Processes & Scheduling knowledge?
Processes & Scheduling
A short quiz for process concepts and CPU scheduling after the Processes section.