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

System Software and Operating System 04 - Daily Class Notes

Uploaded by

Priya Kumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

System Software and Operating System 04 - Daily Class Notes

Uploaded by

Priya Kumari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1

UGC NET

DAILY
CLASS NOTES
Computer

System Software and Operating System


Lecture – 4
Process Scheduling: Part 2
2

Process Scheduling: Part 2


Content:
1. Priority Based Pre-emptive scheduling
2. Round Robin Scheduling
3. Practice Questions scheduling Algorithms

a. Priority-Based with pre-emptive Scheduling:-At the time of scheduling, a process dispatched will be the
one that has highest priority amongst the processes waiting in the Ready Queue. When a process P1 is
executing, if another processP1 of higher priority become ready to run during its execution, then P1will be
preemted by pj.

Process Arrival Time Next Burst ms Process Priority


ms
P0 0 10 5
P1 1 6 4
P2 3 2 2
P3 5 4 0

Ex-5

Average Turn over Time: 12.5 ms


Average waiting Time: 4.5ms

NOTE:-
Priority Pre-emtive WT and TA <Priority Non-Pre-emtive

b. Rmound Robin Scheduling:-This scheduling algorithm is specially tailored for interactive Time-Sharing
Systems. A small unit of time, called Time-slice of Time Quantum is defined.

Process Arrival Time Next Burst ms


ms
P0 0 10
P1 1 6
P2 3 2
P3 5 4
Time Slice = 4ms

Ex- 6
Average Turn over Time: 8.75ms
Average waiting Time: 14.25 ms
3

Q. Consider the following processes with burst times, priority and arrival times.

Process P1 P2 P3 P4
Burst time 5 2 6 4
Priority 4 (low) 3 1 (high) 2
Arrival time 0 2 2 6

Using FCFS scheduling compute the average waiting time of processes (FCFS selects highest priority
process when more than one process arrived at the same time).
A. 4.75 B. 5.25
C. 6.75 D. 8.75
Ans. B
Solution:

Q. Given CPU time slice of 2ms and following list of processes.

Process Burst time (ms) Arrival time


P1 3 0
P2 4 2
P3 5 5

Find average turnaround time and average waiting time using round robin CPU scheduling?
A. 4, 0 B. 5.66, 1.66
C. 5.66, 0 D. 7, 2
Ans. B
Solution:

P1 P2 P1 P2 P3 P3 P3
0 2 4 5 7 9 11 12

Q. Consider the below table and solve the question

Process Arrival Time Service Time


P1 0 7
P2 2 4
P3 4 1
P4 5 4
4

Solve the above problem by using SJF (pre-emptive) and FCFS. Choose the correct option.
A. TAT (SJF) > TAT (FCFS).
B. Throughput (FCFS) > Throughput (SJF)
C. TAT (FCFS) > TAT (SJF)
D. None
Ans. C
Solution:
SJF (Preemptive)

P1 P2 P3 P2 P4 P1
0 2 4 5 7 11 16
Average Turn around Time= 16+5+1+6=28/4=7

FCFS

P1 P2 P3 P4
0 7 11 12
Average Turn Around time: 7+9+11+8 =35/4=8.75

PW Web/App : https://smart.link/7wwosivoicgd4
Library - https://smart.link/sdfez8ejd80if

You might also like