我有一个关于多核和多 Cpu RR 模拟的问题;我试图了解 WTime 是如何为多核和多 CPU 循环模拟算法派生的。我想弄清楚这个假设是否正确?
#CPU => 2;
#Cores => 2;
#Processes => 6;
TQ = 5;
Process# BurstTime
1 5
2 6
3 7
4 8
5 9
6 10
Process RR Algorithm Data
Process# BTime WTime CPU#
1 5 0 1
2 5 0 1
3 5 5 2
4 5 5 2
5 5 10 1
6 5 10 1
2 1 17 2
3 2 17 2
4 3 21 1
5 4 21 1
6 5 26 2
Is the this correct? Specifically P2 WTime?
P1 => 0
P2 => 17 - 0 = 17
P3 => 17 - (5*1) - 0 = 12
P4 => 21 - (5*1) - 0 = 16
P5 => 21 - (5*1) - 0 = 21
P6 => 26 - (5*1) - 0 = 21
计算进程的平均等待时间 => (0 + 17 + 12 + 16 + 21 + 21) / 6