Priority Preventive Planning

When using Priority Preemptive Scheduling, is there a higher priority for the process path with a lower priority but with a shorter batch time?

For example, if I had:

Arrival Time Burst Time Priority P1 0 5 3 P2 2 6 1 P3 3 3 2 

Will a Gantt chart look like this?

 | P1 | P2 | P3 | P1 | 0 2 8 11 16 
+4
source share
3 answers

Priority planning always selects the process with the highest priority that is currently ready to start. If there is more than one process with the highest priority at the present time, a second scheduling algorithm is required to choose between these processes. Non-preemptive Priority Scheduling only selects a new process to start if the executing process has completed its work or given (voluntarily) by the scheduler.

Priority priority planning is one and the same algorithm, but if a new process has a higher priority than the current process, it is selected immediately. The new process should not wait for the completion or completion of the current process.

In your example, the Gantt chart for proactive priority planning and 3 will be the highest and 1 the lowest priority will look:

  |  P1 |  P3 |  P2 |
 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
+11
source
 | p1 | p2 | p3 | p1 | 0....2....8....11...14 

accepts 1 as the highest priority.

+2
source
  |p1 |p2 |p3 |p1 | 0 2 8 11 14 

since the preventive approach will be supplanted if the priority of the newly acquired process is higher than the priority of the current process.

0
source

Source: https://habr.com/ru/post/1395961/


All Articles