Operating System - Process Management Notes
Process Management
1. What is a Process?
A process is a program in execution. It consists of the program counter, stack, data section, and heap.
2. Process States:
New, Ready, Running, Waiting (Blocked), Terminated.
3. Threads vs Processes:
- Process: Independent, has separate memory.
- Thread: Lightweight, shares memory with threads in the same process.
4. Operations on Processes:
- Creation, Termination, Context Switching, Suspension & Resumption.
5. Process Scheduling:
Schedulers: Long-term, Short-term (CPU Scheduler), Medium-term.
Scheduling Criteria: CPU Utilization, Throughput, Turnaround Time, Waiting Time, Response Time.
6. Scheduling Algorithms:
- FCFS (First Come First Serve)
- SJF (Shortest Job First)
- Priority Scheduling
- Round Robin
- Multilevel Queue Scheduling
7. Inter-Process Communication (IPC):
- Shared Memory: Processes access the same memory space.
- Message Passing: Exchange of messages.
8. Deadlocks:
Four conditions: Mutual Exclusion, Hold & Wait, No Preemption, Circular Wait.
Operating System - Process Management Notes
Deadlock Handling:
- Prevention: Break any of the four conditions.
- Avoidance: Use Banker's Algorithm.
- Detection: Use resource allocation graphs.
- Recovery: Terminate or rollback processes.