Priority Based Scheduling

  • Each process is assigned a priority. Process with highest priority is to be executed first and so on.
  • Processes with same priority are executed on first come first serve basis.
  • Priority can be decided based on memory requirements, time requirements or any other resource requirement.

Example:

Process Arrival Time Execute TimePriorityService Time
P0 0 5 1 0
P1 1 3 2 3
P2 2 8 1 8
P3 3 6 3 16


P3

P1

P0

P2

0 6 9 14 22


Wait time of each process is following

ProcessWait Time : Service Time - Arrival Time
P00 - 0 = 0
P13 - 1 = 2
P28 - 2 = 6
P316 - 3 = 13

Average Wait Time: (0+2+6+13) / 4 = 5.25