Priority Based Process Scheduling in operating systems

Priority Based Process Scheduling:

Priority scheduling is a non-preemptive algorithm so processes priority matters.

Each process has a priority number.

Process with high priority always gets the CPU on a priority basis.

Processes with the same priority are executed according to the first come first served(FCFS)scheduling algorithm.

Preferred in batch systems.

Process Burst Time Priority
P1 4 2nd
P2 2 3rd
P3 8 1st
P4 3 4th

 

P3 P1 P2 P4
0                              8                             12                              14                     17

 

Process Waiting Time
P1 8
P2 12
P3 0
P4 14

Average Wait Time: (0+8+12+14) / 4 = 8.5

Priority Based Process Scheduling Program in C++ (C Plus Plus)

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/

Leave a Reply