It depends. As it is implemented in the usual Round Robin, where there is no priority, then we must preempt P2. But this has a priority for him, which we exaggerate, but no matter what process has the next highest priority (so that everything is simple).
Suppose it is implemented in this way:
- Processes are only unloaded using the Round Robin temporary fragment.
- The priority will simply be based on the order of the processes in the RR (to avoid problems with starvation)
This may differ from what is in your book, for example, it can increase the priority of processes depending on how long they were in the queue, and then pre-empt the current maximum (in which there can be one and the same process). But, as I defined above, is more focused on Round Robin sharing. In this case, P1 unloaded and we go to P2 , just as normal RR works.
But let's move on to a better example, say that we have P1 (priority = high) , P2 (priority = low) and P3 (priority = med) . And then enter the queue in the order: P1, P2, P3. Then, as I defined Priority RR, you will do the following:
P1 -> [high] Notice the priority simply changes the ordering P3 -> [med] But each still has the same time slice. P2 -> [low] P1 P3 P2
Each with a temporary fragment of N Of course yes, it does not look. Priority plays a big role here, RR pays more attention. But since the number of processes in the finished queue is large (and, possibly, the time slice is large), then it will play a slightly larger factor.
source share