Problems on scheduling algorithms
Problems on scheduling algorithms
For all scheduling algorithms calculate the waiting time for each
process, turnaround time for each process and average waiting
time
Problem-01:
Consider the set of 5 processes whose arrival time and burst time are given
below-
Arrival Burst
Process Id
time time
P1 3 4
P2 5 3
P3 0 2
P4 5 1
P5 4 3
Problem-02:
Consider the set of 3 processes whose arrival time and burst time are given
below-
P1 0 2
P2 3 1
P3 5 6
Problem-03:
Consider the set of 6 processes whose arrival time and burst time are given
below-
P1 0 3
P2 1 2
P3 2 1
P4 3 4
P5 4 5
P6 5 2
Practice Problem based on Non-Preemptive Shortest Job
First CPU Scheduling Algorithm:
1.
Process Burst Time Arrival Time
P1 6 ms 2 ms
P2 2 ms 5 ms
P3 8 ms 1 ms
P4 3 ms 0 ms
P5 4 ms 4 ms
2.
Practice Problem based on Preemptive Shortest Job First
CPU Scheduling Algorithm:
1.
Process Burst Time Arrival Time
P1 6 ms 2 ms
P2 2 ms 5 ms
P3 8 ms 1 ms
P4 3 ms 0 ms
P5 4 ms 4 ms
2.
P1 3 1
P2 1 4
P3 4 2
P4 0 6
P5 2 3
3.
P1 3 1
P2 1 4
P3 4 2
P4 0 6
P5 2 3
4.
P1 0 7
P2 1 5
P3 2 3
P4 3 1
P5 4 2
P6 5 1
5.
P1 0 9
P2 1 4
P3 2 9
6.
P1 0 20
P2 15 25
P3 30 10
P4 45 15
Practice Problem based on Priority Scheduling Algorithm:
1.
P1 0 4 2
P2 1 3 3
P3 2 1 4
P4 3 5 5
P5 4 2 5
2.
P1 0 4 2
P2 1 3 3
P3 2 1 4
P4 3 5 5
P5 4 2 5
3.
Process Priority Burst time Arrival time
P1 1 4 0
P2 2 3 0
P3 1 7 6
P4 3 4 11
P5 2 2 12
4.
Process Priority Burst Time Arrival Time
P1 1 4 0
P2 2 3 0
P3 1 7 6
P4 3 4 11
P5 2 2 12
P1 0 5
P2 1 3
P3 2 1
P4 3 2
P5 4 3
P1 0 4
P2 1 5
P3 2 2
P4 3 1
P5 4 6
P6 6 3
Time quantum = 2
3.
Process Id Arrival time Burst time
P1 5 5
P2 4 6
P3 3 7
P4 1 9
P5 2 2
P6 6 3
Time quantum = 3
4.
Four jobs to be executed on a single processor system arrive at time 0 in the order
A, B, C, D. Their burst CPU time requirements are 4, 1, 8, 1time units
respectively. Apply Round Robin scheduling for time quantum of 1 unit
5.
Process Burst Time Arrival Time
P1 5 ms 0 ms
P2 4 ms 1 ms
P3 2 ms 2 ms
P4 1 ms 4 ms
Time quantum = 2
6.
1 0 5
2 1 6
3 2 3
4 3 1
5 4 5
6 6 4
Time quantum = 4 units
Prescribed textbook problems
- Dr. Varalatchoumy M
Associate Professor, CSE, CITech