7. CPU Scheduling

0. 文件地址

Homework

1. Workload Assumptions

在这里插入图片描述

2. Scheduling Metrics

在这里插入图片描述
在这里插入图片描述

3. First In, First Out (FIFO)

在这里插入图片描述

4. Shortest Job First (SJF)

在这里插入图片描述

5. Shortest Time-to-Completion First (STCF)

在这里插入图片描述
在这里插入图片描述

6. A New Metric: Response Time

在这里插入图片描述

7. Round Robin

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

8. Incorporating I/O

在这里插入图片描述

9. Homework (Simulation)

在这里插入图片描述

Question & Answer

在这里插入图片描述

1. Compute the response time and turnaround time when running three jobs of length 200 with the SJF and FIFO schedulers

FIFO:

在这里插入图片描述
在这里插入图片描述

SJF:

在这里插入图片描述
在这里插入图片描述

2. Now do the same but with jobs of different lengths: 100, 200, and 300.
2.1

FIFO: 100 200 300
在这里插入图片描述
在这里插入图片描述

SJF: 100 200 300
在这里插入图片描述
在这里插入图片描述

2.2

FIFO: 300 200 100
在这里插入图片描述
在这里插入图片描述
SJF: 300 200 100
在这里插入图片描述
在这里插入图片描述

3. Now do the same, but also with the RR scheduler and a time-slice of 1.

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4. For what types of workloads does SJF deliver the same turnaround times as FIFO?

When the workload doesn’t arrive from large to small.

5. For what types of workloads and quantum lengths does SJF deliver the same response times as RR?

The RR scheduling strategy is to execute a time slice in sequence in the job list, let the length of the time slice be T, then the response time of the Nth job is (N-1) * T, and SJF needs to finish one job before executing another job. Therefore, the execution time of each job of the SJF strategy should be equal to the time slice of the RR strategy.

6.What happens to response time with SJF as job lengths increase? Can you use the simulator to demonstrate the trend?

When the job length increases, the waiting response time for subsequent jobs will increase accordingly.

在这里插入图片描述
在这里插入图片描述

7. What happens to response time with RR as quantum lengths increase? Can you write an equation that gives the worst-case response time, given N jobs?

Assuming the length of the time slice is T, the response time of the Nth job = (N - 1)* T.
When the quantum lengths increase, the response time will increase accordingly.

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值