OS Report
OS Report
Submitted To:
Ms. Madiha Khurram
By:
BSSE-II (Morning)
GROUP 13:
o Ibreez (B22110106029)
o Iqra Habib (B22110106030)
o Omaima Atif (B22110106064)
o Omama Batool (B22110106065)
o Wardah (B22110106088)
1|Page
Comparative Study on the CPU Scheduling Algorithms
Abstract:
The CPU is a central and critical resource within a computer system, responsible for
executing processes and tasks. CPU scheduling is the method used to determine which
process gains access to the CPU for execution while other processes await their turn.
Effective CPU scheduling is essential for maximizing CPU utilization, a key service
provided by the operating system to enhance system performance. This report reviews
prominent CPU scheduling algorithms—namely, Round Robin (RR), Shortest Job First
(SJF), First Come First Served (FCFS), and Priority Scheduling—assessing their
advantages and limitations. Numerous studies have proposed enhancements to these
algorithms to optimize key performance metrics, such as waiting time, response time,
and turnaround time. However, findings indicate that while each algorithm has strengths
in specific areas, no single approach universally excels across all criteria.
Introduction:
Technology has transformed human life by enabling tasks like shopping, studying, and
booking appointments via devices like mobile phones and computers. Operating
systems emerged to simplify the management of these complex devices, acting as
intermediaries between users and hardware, providing user interfaces, and managing
resources efficiently. In multi-processing systems, CPU scheduling is essential for
managing multiple processes that require the CPU but can only use it one at a time.
Scheduling algorithms maximize CPU utilization by reducing turnaround time, waiting
time, and response time.
2|Page
Identified Problems Of Scheduling Algorithms:
Inefficiencies in Existing Algorithms:
Some CPU scheduling algorithms (e.g., FCFS, SJF, Priority, RR) have inherent
limitations, such as high wait times, response delays, and CPU resource
underutilization, especially when dealing with varying workloads.
Unbalanced Performance Metrics:
No single algorithm performs optimally across all important metrics—waiting
time, response time, turnaround time, CPU utilization—resulting in compromises
based on the system's needs.
Risk of Starvation:
Algorithms like SJF and Priority can lead to starvation of low-priority or long-
burst-time processes, impacting fairness and system responsiveness.
Proposed Solutions
Enhanced and Hybrid Algorithms
Researchers proposed various modified or hybrid versions of traditional scheduling
algorithms to balance the different metrics effectively. Examples include:
o Dynamic Round Robin (RR) variations, which adjust the time quantum based on the
workload to minimize context switches and improve response time.
3|Page
Comparisons Between Different Scheduling Algorithms:
Basic Principle Processes are Executes shortest Processes are Each process gets
served in the jobs first. executed based a fixed time slice
order they arrive on priority. (quantum).
Fairness Low fairness, long Can lead to Low fairness, Fair, each job gets
jobs may cause starvation of long lower-priority jobs CPU access
delays. jobs. wait long. periodically.
Response Time Higher for long Lower for short Depends on Moderate
queues jobs priority and queue response,
length depends on time
quantum.
Throughput Moderate High for small jobs Depends on Moderate, high for
priority distribution short quantum.
Turnaround Time Long for longer Generally optimal Higher for low- High for high-load
queues for short jobs priority processes systems if
quantum is large.
Waiting Time Can be high for Low for short Low for high- Varies with
long processes in processes priority, high for quantum size, but
queue low-priority more balanced.
Best Use Case Suitable for batch Suitable for short Suitable for Time-sharing
systems burst-time jobs systems with systems requiring
priority needs fair allocation.
Risk of No starvation risk High risk for long High risk for low- No starvation; all
Starvation processes priority processes processes get a
time slice.
4|Page
Results:
Improved Performance Metrics: Enhanced and hybrid scheduling algorithms
demonstrated improvements in key metrics:
Reduced Waiting and Response Times: Dynamic and adaptive algorithms showed
better response times for critical processes and reduced average waiting time, especially
under varied workloads.
Enhanced CPU Utilization and Throughput: Algorithms that adjusted based on
workload conditions resulted in higher CPU utilization and better overall throughput,
maximizing resource use.
Minimized Context Switching Overheads: Modified RR algorithms with dynamic
quantum helped reduce context switching, which further optimized CPU performance.
Balanced System Performance: While no single algorithm was ideal for all conditions,
the modified and hybrid approaches provided more balanced performance, addressing
specific needs (e.g., minimizing delays or improving fairness) based on the workload and
system requirements.
These findings indicate that while traditional algorithms each have their benefits, the use
of optimized or hybrid approaches provides a more adaptable solution for diverse
scheduling needs.
5|Page