100% found this document useful (2 votes)
9K views8 pages

Priority and Round Robin Scheduling

This document discusses different types of priority scheduling, including preemptive and non-preemptive priority scheduling. It provides examples to illustrate how to calculate average waiting times using each method. With non-preemptive priority scheduling, processes are scheduled according to priority without preemption. Preemptive priority scheduling allows higher priority processes to preempt, or interrupt, lower priority processes. The document also introduces round-robin scheduling, which uses a time quantum to preemptively schedule processes in a cyclic order, and provides an example to calculate average waiting time using this method.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
9K views8 pages

Priority and Round Robin Scheduling

This document discusses different types of priority scheduling, including preemptive and non-preemptive priority scheduling. It provides examples to illustrate how to calculate average waiting times using each method. With non-preemptive priority scheduling, processes are scheduled according to priority without preemption. Preemptive priority scheduling allows higher priority processes to preempt, or interrupt, lower priority processes. The document also introduces round-robin scheduling, which uses a time quantum to preemptively schedule processes in a cyclic order, and provides an example to calculate average waiting time using this method.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

PRIORITY SCHEDULING

Types of priority scheduling:

 Preemptive priority scheduling

 Non- preemptive priority scheduling


As an example:

Process Arrival time Burst time (in Priority


(in ms) ms)
P1 0 11 2
P2 2 1 3
P3 3 4 2
P4 4 2 1

Using non-preepmtive priority scheduling, we schedule these processes


according to following Gantt Chart -

P1 P4 P3 P2
0 11 13 17 18

Average waiting time = {0 + (17-2) + (13-3) + (11-4)} /4 = 8 ms


Using preepmtive priority scheduling, we schedule these processes
according to following Gantt Chart -

P1 P4 P1 P3 P2
0 4 6 13 17 18

Average waiting time = {(6-4)+(17-2)+(13-3)+(11-4)} /4


= 6.75 ms
 Indefinite blockage – A major problem
of priority scheduling

 Aging – Its solution


ROUND – ROBIN SCHEDULING

- A preemptive scheduling
As an example:

Process Burst time (in


ms)
P1 4
Time quantum = 3 ms
P2 2
P3 6
P4 1

Using round – robin (RR) scheduling, we schedule these processes


according to following Gantt Chart -

P1 P4 P3 P2

Average waiting time = {(9-3) + 3 + (10-5) + 8} /4 = 5.5 ms


References:
Operating System Concepts 7th_ed,Silberschatz,Galvin

You might also like