OSTEP第七章代码
Posted otakus
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OSTEP第七章代码相关的知识,希望对你有一定的参考价值。
1. Compute the response time and turnaround time when running three jobs of length 200 with the SJF and FIFO schedulers.
没区别,
响应时间 | 周转时间 | 等待时间 | |
1 | 0 | 200 | 0 |
2 | 200 | 400 | 200 |
3 | 400 | 600 | 400 |
平均 | 200 | 400 | 200 |
2. Now do the same but with jobs of different lengths: 100, 200, and 300.
FIFO和SJF都很好算出来,所以不用了
3. Now do the same, but also with the RR scheduler and a time-slice of 1.
加个-c 输出细节 命令和上面差不多: ./scheduler.py -p RR -l 200,200,200 -c
可以很详细的得到response time 和turnaround time
4. For what types of workloads does SJF deliver the same turnaround times as FIFO?
只要-l 后的序列长度满足l1<l2<l3<..<ln,这样通过最前任务执行最短时间,总是有相同的周转时间
5. For what types of workloads and quantum lengths does SJF deliver the same response times as RR?
每个任务的时间长度和时间片相等时候
6. What happens to response time with SJF as job lengths increase? Can you use the simulator to demonstrate the trend?
会增加,模仿的话。。。可以用matlibplot但是不想
7. What happens to response time with RR as quantum lengths increase? Can youwrite an equation that gives theworst-case response time, given N jobs?
可以看出是随着时间片长大的
Time(N)=(N−1)∗q
average Time=(N−1)∗q/2,N=N(max)
以上是关于OSTEP第七章代码的主要内容,如果未能解决你的问题,请参考以下文章