Round-Robin Scheduling Algorithm: Why p3 is Before p2 at t=12
In the round-robin scheduling algorithm, each process is given a fixed time quantum to execute on the CPU before it is preempted and another process is given a chance to execute. This ensures fair sharing of the CPU among processes.
\nIn the given scenario, at t=12, the CPU queue has the following processes:
\np1: CPU burst time = 4, I/O burst time = 2
\np2: CPU burst time = 3, I/O burst time = 2
\np3: CPU burst time = 2, I/O burst time = 4
\nAt t=12, p1 has already completed its CPU burst and is in the I/O state, p2 still has 1 unit of CPU burst time remaining, and p3 has completed its entire CPU burst time.
\nSince p3 has completed its CPU burst time, it has higher priority in the CPU queue compared to p2, which still has some remaining CPU burst time. Therefore, p3 will be scheduled to run on the CPU before p2 at t=12.
AI 优化版
原文地址:https://www.cveoy.top/t/topic/pt1F 著作权归作者所有。请勿转载和采集!