



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
操作系统作业 5 2 Discuss how the following pairs of scheduling criteria confl ict in certain settings a CPU utilisation and response time b Average turnaround time and maximum waiting time c I O device utilisation and CPU utilisation a CPU utilisation and response time CPU utilisation is increased if the overheads associated with context switching is minimised The context switching overheads could be lowered by performing context switches infrequently This could however result in increasing the response time for processes b Average turnaround time and maximum waiting time Average turnaround time is minimised by executing the shortest tasks fi rst Such a scheduling policy could however starve long running tasks and thereby increase their waiting time c I O device utilisation and CPU utilisation CPU utilisation is maximised by running long running CPU bound tasks without performing context switches I O device utilisation is maximised by scheduling I O bound jobs as soon as they become ready to run thereby incurring the overheads of context switches 5 5 Which of the following scheduling algorithms could result in starvation a First come fi rst served b Shortest job fi rst c Round robin d Priority Answer Short time fi rst and Priority scheduling algorithms may contribute to starvation Starvation is situation that thread has arrived but have to wait for the CPU to be executed because of CPU occupied by other threads an the same time 5 7问 long running tasks 有什么区别 Consider a system running ten I O bound tasks and one CPU bound task Assume that the I O bound tasks issue an I O operation once for every millisecond of CPU computing and that each I O operation takes 10 milliseconds to complete Also assume that the context switching overhead is 0 1 millisecond and that all processes are long running tasks What is the CPU utilisation for a round robin scheduler when a The time quantum is 1 millisecond The time quantum is 1 millisecond Irrespective of which process is scheduled the scheduler incurs a 0 1 millisecond context switching cost for every context switch This results in a CPU utilisation of 1 1 1 100 91 b The time quantum is 10 milliseconds The time quantum is 10 milliseconds The I O bound tasks incur a context switch after using up only 1 millisecond of the time quantum The time required to cycle through all the processes is therefore 10 1 1 10 1 as each I O bound task executes for 1 millisecond and then incur the context switch task whereas the CPU bound task executes for 10 milliseconds before incurring a context switch The CPU utilisation is therefore 20 21 1 100 94 CPU利 用率计算 方法 假设 一段时间total内 该任务的运 行时间为idle cpu利 用 率的计算公式为 total idle total 这 一种 方法实现起来很简单 但是它只 能算得整个系统的cpu使 用情况 不能得到单个任务 的cpu使 用情况 同时它 会使cpu满负荷 工作 题 目中 提到的 that the I O bound tasks issue an I O operation once for every millisecond of CPU computing 意思是I O bound tasks 每个耗时是1毫秒 有 十个这样的任务 而 each I O operation takes 10 milliseconds to complete 意思是每个 CPU bound task每个耗时10毫秒 但是 只有 一个 优先级转换速率是什么 5 9 Consider a preemptive priority scheduling algorithm based on dynamically changing priorities Larger priority numbers imply higher priority When a process is waiting for the CPU in the ready queue but not running its priority changes at a rate when it is running its priority changes at a rate All processes are given a priority of 0 when they enter the ready queue The parameters and can be set to give many different scheduling algorithms a What is the algorithm that results from 0 b What is the algorithm that results from 0 Answer a FCFS 先来先服务 从就绪队列中选择 一个或若 干个最先进 入该队列的进程 将 他们调 入内存运 行 b LIFO 后进先出 从就绪队列中选择 一个或若 干个最后进 入该队列的进程 将它们调 入内存运 行 5 10 Explain the differences in the degree to which the following scheduling algorithms discriminate in favour of short processes a FCFS b RR c Multilevel feedback queues Answer a FCFS discriminates against short jobs since any short jobs arriving after long jobs will have a longer waiting time 秉承先来先服务原则 所以 短程任务如果在长程任务之后到来 就 必须等待 这样 子就等待蛮长时间的 所以对短程任务不利 b RR treats all jobs equally giving them equal
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年机房温控节能项目发展计划
- 2025版航空航天数据处理设备采购服务合同范本
- 二零二五年度房地产股权转让与联合开发投资合同
- 二零二五年度办公场所空调安全使用规范合同
- 2025版离婚子女抚养权及财产分割协议书
- 二零二五房地产策划推广五大步骤效果评估合同
- 二零二五年度豪华房产出售广告合同范例
- 2025年度文化艺术场馆保安巡逻与文物保护合同
- 2025年度互联网数据中心IDC托管服务合同样本
- 二零二五年度商砼产品定制化生产及销售合同
- 2025年高考英语复习专项突破:阅读理解之词义猜测题(解析版)
- 2024年西藏自治区中考化学试题卷(含答案)
- 常用经典日语句子大全
- 2024年中国全屋定制行业市场调查、产业链全景及市场需求规模预测报告
- 物流无人机垂直起降场选址与建设规范
- “四标四实”项目建设方案
- 广西南宁市青秀区第二中学2024届物理八下期末质量检测试题含解析
- 新生儿二月闹课件
- 天然气制氢方案
- 锅炉A级检修炉膛架子三措两案
- 高考自招题库-卓越联盟历年自主招生真题及模拟题
评论
0/150
提交评论