CPU SCHEDULING ALGORITHMS - CS3451 (Operating Systems)
1. First Come First Serve (FCFS)
- Type: Non-preemptive
- Order: Processes executed in the order they arrive
- Advantages: Simple, easy to implement.
- Disadvantages: Convoy effect, poor for time-sharing.
2. Shortest Job First (SJF)
- Type: Non-preemptive / Preemptive (SRTF)
- Order: Shortest burst time first
- Advantages: Minimizes average waiting time.
- Disadvantages: Requires future knowledge, starvation possible.
3. Round Robin (RR)
- Type: Preemptive
- Time Quantum: Fixed time slice
- Advantages: Good for time-sharing, fair
- Disadvantages: High overhead if quantum is too small
4. Priority Scheduling
- Type: Preemptive / Non-preemptive
- Order: Based on priority (lower number = higher priority)
- Advantages: Important tasks get CPU early
- Disadvantages: Starvation possible, solved by aging
5. Multilevel Queue Scheduling
- Type: Static multiple queues (e.g., System: RR, User: FCFS)
- Processes fixed to queues
6. Multilevel Feedback Queue (MLFQ)
- Type: Dynamic, processes can move between queues
- Advantages: Flexible, adapts to behavior
- Disadvantages: Complex
Formulas:
- Turnaround Time (TAT) = Completion Time - Arrival Time
- Waiting Time (WT) = Turnaround Time - Burst Time
- Average TAT/WT = Sum of TATs / WTs ÷ Number of Processes