Priority (Non-Preemptive) Algorithm

Priority Scheduling is a method of scheduling processes that is based on priority. In this algorithm, the scheduler selects the tasks to work as per the priority. The processes with higher priority should be carried out first, whereas jobs with equal priorities are carried out on FCFS basis. Priority depends upon memory requirements, time requirements, etc. In Priority (Non-Preemptive) scheduling method, the CPU has been allocated to a specific process. The process that keeps the CPU busy, will release the CPU either by switching context or terminating.

Characteristics

Advantages

Disadvantages

Example

Process Priority Arrival Time Burst Time
P1 0(L) 0 4
P2 4 1 5
P3 5 2 6
P4 10 3 7
P5 8 4 6
P6 17(H) 7 5
P7 9 8 4

Working

Gantt Chart

P1 P4 P6 P7 P5 P3 P2
0 - 4 4 - 11 11 - 16 16 - 20 20 - 26 26 - 32 32 - 37

Final Table

Process Priority Arrival Time Burst Time Completion Time Turn Around Time Waiting Time Response Time
P1 0(L) 0 4 4 4 0 0
P2 4 1 5 37 36 31 31
P3 5 2 6 32 30 24 24
P4 10 3 7 11 8 1 1
P5 8 4 6 26 22 16 16
P6 17(H) 7 5 16 9 4 4
P7 9 8 4 20 12 8 8