Final - Advanced OS Presentation GroupE
Final - Advanced OS Presentation GroupE
Scheduling
Advance Operating System (Mid Term Project)
Student Name ID
Sabiba Tasnim Sameka 23-93092-3
Romona Magdalene Sarkar 24-93338-1
Fahim Faysal Sakib 24-93346-1
Md Sajjadul Islam Juel 23-93164-3
Tushar Md Asaduzzaman 23-93163-3
TOPICS TO BE COVERED
❏ Throughput should be Maximum. i.e. Number of processes that complete their execution per time unit
should be maximized.
❏ Minimum response time. It means that the time when a process produces the first response should be
as less as possible.
Types of CPU Scheduling
1. Non-preemptive Scheduling:
CPU is allocated to the process until it terminates.
No switching takes place.
2. Preemptive Scheduling
Interrupts processes, forcing them to give control to other
processes.
Provides better responsiveness.
Tasks are switched based on priority.
Why use Round Robin?
Round Robin
Real-time algorithm as it responds to an
event within a specific time limit.
focuses on the Time Sharing technique.
► It is a Preemptive type of CPU scheduling algorithm in OS.
One of the oldest, fairest, and easiest
algorithm. ► Every process gets a fixed amount of time quantum to
execute the process.
Every process gets an equal share of the
CPU. ► Processes that have their burst time remaining after the
Distributes work evenly among all expiration are sent back to the ready state and wait for their
available resources. next turn to complete the execution until it terminates.
Helps in resource utilization and overall ► The CPU time quantum is the time period defined in the
performance of the system. system.
Priority Scheduling with
Round Robin Why Use Priority Scheduling
with Round Robin?
Ensures fairness
Each process to execute for a fixed
In priority scheduling with Round-Robin, processes are
time slice regardless of its priority
scheduled based on their priority levels.
Useful in real-time systems where
A higher-priority process is given the CPU over lower-
tasks have strict deadlines
priority processes.
Dynamic environments where the If multiple processes have the same priority, Round-Robin
priority of processes may change over
scheduling is used to ensure fairness and prevent starvation.
time
The CPU is allocated to the process with the highest priority
Responsiveness (smallest integer highest priority)
Round Robin Example
Mode Preemptive
P1 0 5
P2 1 4
P3 2 2
P4 4 1
Quantum Time = 2
Continue
P1 0 5
P2 1 4
Quantum Time = 2
P3 2 2
P4 4 1
P1 P2 P3 P1 P4 P2 P1
Ready Queue
P1 P2 P3 P1 P4 P2 P1
Running Queue
0 2 4 6 8 9 11 12
Calculation
P1 P2 P3 P1 P4 P2 P1
Running Queue
0 2 4 6 8 9 11 12
Process Arrival Time Brust Time Completion Time Turnaround Time Waiting Time
P1 0 5 12 12 7
P2 1 4 11 10 6
P3 2 2 6 4 2
P4 4 1 9 5 4
P1 4 3
P2 5 2
P3 8 2
P4 7 1
P5 3 3
Quantum Time = 2
Continue
Process Burst Time (ms) Priority
P1 4 3
P2 5 2
Quantum Time = 2
P3 8 2
P4 7 1
P5 3 3
Running Queue P4 P2 P3 P2 P3 P2 P3 P1 P5 P1 P5
/ Gantt Chart
0 7 9 11 13 15 16 20 22 24 26 27
Calculation
P4 P2 P3 P2 P3 P2 P3 P1 P5 P1 P5
Running Queue
0 7 9 11 13 15 16 20 22 24 26 27
Process Burst Time Priority Completion Time Turnaround Time Waiting Time
P1 4 3 26 26 22
P2 5 2 16 16 11
P3 8 2 20 20 12
P4 7 1 7 7 0
P5 3 3 27 27 24