I am having similar problem, in case of round robin where priority is associated. I am not convinced by my teacher's explanation, that say P1,P2,P3 has the same arrival time and their priority is as : P3>P2>P1.The round robin scheduling order is as P3 -> P2 -> P1 -> P3 -> P2 ->.... I am convinced that this is the logical sequence but my teacher disregards this and claims that the priority will ...
1. Priority Scheduling Algorithm: Priority scheduling algorithm executes the processes depending upon their priority. Each process is allocated a priority and the process with the highest priority is executed first.
RR Scheduling algorithm is preemptive because no process is allocated to the CPU for more than one time quantum in a row. If a process CPU burst exceeds 1 time quantum, that process is pre-empted and is put back in ready queue
You are right, Round Robin is the preemptive approach to FCFS, and FCFS is the non-preemptive approach to Round Robin. Other than that the algorithms have almost everything in common.
Prerequisite – Program for Round Robin scheduling Processes are executed on basis of their priority in this scheduling algorithm. Processes have a specific priority associated with them on arrival. When a process arrives its priority is compared with other processes in the ready queue and if its priority is higher then it becomes running process.
Preemptive Scheduling is a CPU scheduling technique that works by dividing time slots of CPU to a given process. The time slot given might be able to complete the whole process or might not be able to it. When the burst time of the process is greater than CPU cycle, it is placed back into the ready queue and will execute in the next chance.
The Round Robin scheduling algorithm is a preemptive scheduling algorithm. It uses a concept of time slice or time quantum. The process at the beginning of the ready queue gets the chance to be executed first but only for the span of one-time quantum.
So, its priority increases. So, we can say that Round Robin is a special kind of Preemptive Priority Scheduling Algorithm where a process in the ready queue gets its priority increased and a process in the CPU gets its priority decreased.
In Round Robin Scheduling Algorithm, when a process is already in the CPU being executed it has a limited time quantum which it gets to execute within but if it cannot complete itself then it gets preempted. So as the time quantum progresses the chances of the process being preempted increases. Its priority decreases.