Operating Systems | Scheduling Algorithm: Priority Scheduling


Priority Scheduling

The algorithms schedules the process with highest priority from available processes available on main memory.

It is of two types

  • Static Priority Scheduling
  • Where once the priority is assigned for a process,the priority of a process will not change till termination of the process.

  • Dynamic Priority Scheduling
  • In dynamic priority scheduling the priority might change during processing the program.

The priority scheduler with methods to suspend processes during execution of program is called preemptive priority scheduler and with out such methods are known as preemptive scheduler. Among two process with same priority, once which arrived first will have higher precedence and if those are also equal the chronological order of process id would considered.

Example: Consider the table of processes which will be executed using preemptive priority scheduling algorithm. Find the completion time, turnaround time and waiting time for each of them?

Process Number Priority AT BT
1 2 0 2
2 3 1 1
3 1 2 2
4 5 3 2



Answer:

Processes representation :

Observations :

Process Number Priority AT BT CT TAT WT
1 2 0 2 3 3 1
2 3 1 1 2 1 0
3 1 2 2 7 5 3
4 5 3 2 5 2 0

Comments