0% found this document useful (0 votes)
8 views

OS Report

Uploaded by

Iqra Ghori
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

OS Report

Uploaded by

Iqra Ghori
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Report Submission:

Comparative Study on the CPU Scheduling Algorithms


Course:
Introduction to Operating System (404)

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.

CPU Scheduling Algorithms:


CPU scheduling algorithms are techniques used by an operating system to manage
how multiple processes access the CPU. Since only one process can use the CPU at
any given time in a single-core system, these algorithms determine the order and timing
in which processes are executed. The primary goal is to maximize CPU utilization and
system efficiency by balancing factors like response time, throughput, turnaround time,
and waiting time. CPU scheduling algorithms aim to optimize resource allocation,
minimize delays, and ensure fair access for all processes, based on predefined criteria.

Types of CPU Scheduling Algorithms:


There are mainly two types of scheduling methods:
 Preemptive Scheduling: Preemptive scheduling is used when a process
switches from running state to ready state or from the waiting state to the ready
state.
 Non-Preemptive Scheduling: Non-Preemptive scheduling is used when a
process terminates, or when a process switches from running state to waiting
state.

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.

o Priority-based RR or SJF-RR combinations that mitigate starvation by incorporating


priority scheduling or shortest job-first mechanisms with RR’s fair time allocation.

o Optimized SJF with Anti-Starvation Measures to ensure that long or low-priority


processes are not indefinitely delayed.

 Adaptation of Time Quantum and Prioritization


Many proposed algorithms dynamically adjust time quantum or apply adaptive priorities
to better handle real-time constraints and minimize waiting or turnaround times.

3|Page
Comparisons Between Different Scheduling Algorithms:

Aspect First-Come-First Shortest Job Priority Round Robin


Serve (FCFS) First (SJF) Scheduling (RR)

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).

Preemptive or Non-preemptive Can be Can be Preemptive


Non-Preemptive preemptive or preemptive or (switches after
non-preemptive non-preemptive time 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.

Complexity Simple and easy Moderate Moderate, Moderate,


to implement (requires burst- requires priority requires time
time sorting) management quantum
management

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

You might also like