Consider the following preemptive priority scheduling algorithm based on dynamic
ID: 3565988 • Letter: C
Question
Consider the following preemptive priority scheduling algorithm based on dynamically changing priorities. Smaller priority number implies higher priority. When a process is waiting for the CPU (in the ready queue, but not running), its priority changes at a rate a; when it is running, its priority changes at a rate b. All processes are given a priority of 10 when they are created (enter the ready queue for the first time). The parameters a and b can be set to give many different scheduling algorithms
1. What is the algorithm that results from a > b > 0?
2. What is the algorithm that results from a < b < 0?
3. Is there a starvation problem in 1) or 2)? Explain.
Explanation / Answer
(a) Since processes start at 0, any processes that have been in the system (either running or waiting) have higher priority. Therefore, new processes go to the back of the queue. When a process runs, its priority keeps increasing at the rate of beta, which is more of an increase than for the processes in the ready queue. Therefore, every time the process has timerrunout, it goes to the front of the ready queue and gets dispatched again. This is the equivalent of FCFS. (b) This time, any new processes entering the system have higher priority than any old ones, since priority starts at zero and then becomes negative when the process waits or runs. New processes go in at the front of the queue. When a process runs or waits, its priority decreases, with the waiting processes decreasing faster than the running process. This is a LIFO (last-in-first-out) algorithm. The question didn't promise that this would be an algorithm you would want to use in real life. where alpha is a and beta is b. Used this expression as i had to do an assignement on this too :)