Question: Consider the following preemptive priority-scheduling algorithm based on dynamically changing priorities. Larger numbers imply higher priority. Tasks are preempted whenever there is a higher priority
Consider the following preemptive priority-scheduling algorithm based on dynamically changing priorities. Larger numbers imply higher priority. Tasks are preempted whenever there is a higher priority task. When a task is waiting for CPU (in the ready queue, but not running), its priority changes at a rate of a:
P(t) = P0 + a (t - t0)
where t0 is the time at which the task joins the ready queue and P0 is its initial priority, assigned when the task enters the ready queue or is preempted. Similarly, when it is running, the tasks priority changes at a rate b. The parameters a, b and P0 can be used to obtain many different scheduling algorithms.
c. Suppose tasks are assigned a priority 0 when they arrive, but they retain their priority when they are preempted. What happens if two tasks arrive at nearly the same time and a > 0 > b?
d. How should we adjust the algorithm to eliminate this pathology?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
