码迷,mamicode.com
首页 > 其他好文 > 详细

OSTEP第七章代码

时间:2020-06-24 00:07:01      阅读:83      评论:0      收藏:0      [点我收藏+]

标签:lsp   第七章   http   math   com   open   atl   sim   inf   

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)=N1q

average Time=N1q/2,N=N(max)

OSTEP第七章代码

标签:lsp   第七章   http   math   com   open   atl   sim   inf   

原文地址:https://www.cnblogs.com/otakus/p/13185379.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!