下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上第二章作业14. Whats the biggest advantage of implementing thread in user space? Whats the biggest disadvantage?Solution: The first advantage is that a user-level package can be implemented on an operating system that does not support threads. The second advantage is that they allow each proc
2、ess to have its own customized scheduling algorithm.The disadvantage is the problem of how blocking system calls are implemented. Another problem is that if a thread starts running, no other thread in that process will ever run unless the first thread voluntarily gives up the CPU.35. Measurements of
3、 certain system have shown that the average process runs for a time T before blocking on I/O. A process switch requires a time S, which is effectively wasted (overhead). For round-robin scheduling with quantum Q, give a formula for the CPU efficiency for each of the following:(a) Q= CPU efficiency=T
4、/ (T+S)(b) Q>T CPU efficiency= T/ (T+S)(c) S<Q<T CPU efficiency=T/ (T+ST/Q)(d) Q=S CPU efficiency=50%(e) Q nearly 0 CPU efficiency is nearly 036. Five jobs are waiting to be run. Their expected run times are 9, 6, 3, 5, and X. In what order should they be run to minimize average response ti
5、me?(Your answer will depend on X.)Solution:IF (X<=3): X, 3, 5, 6, 9IF (X>=3 AND X<=5): 3, X, 5, 6, 9IF (X>=5 AND X<=6): 3, 5, X, 6, 9IF (X>=6 AND X<=9): 3, 5, 6, X, 9IF (X>=9): 3, 5, 6, 9, X37. Five batch jobs A through E, arrive at a computer center at almost the same time.
6、They have estimated running times of 10, 6, 2, 4, and 8 minutes. Their (externally determined) priorities are 3, 5, 2, 1, and 4, respectively, with 5 being the highest priority. For each of the following scheduling algorithms, determine the mean process turnaround time. Ignore process switching over
7、head.(a) Round robin(b)Priority scheduling(c)First-come, first-served (run in order 10, 6, 2, 4, 8)(d)Shortest job firstFor (a), assume that the system is multiprogrammed, and that each job gets its fair share of the CPU. For (b) through (d) assume that only one job at a time runs, until it finishes
8、. All jobs are completely CPU bound.Solution:processesArrival timeProcessing timepriorityA0 (1)103B0 (2)65 (HIGH)C0 (3)22D0 (4)41E0 (5)84(a) Round robin (quantum=2)A2AAEABCDEBDEBEATurnaround time:A: 10+6+2+4+8=30B: 30-4*2=22C: 2+2+2=6D: 2*8=16E: 30-2=28Mean turnaround time= (30+22+6+16+28)/5=80/5=20
9、.4(b) priority scheduling6ACBED81024Turnaround time:A: 6+8+10=24B: 6C: 24+2=26D: 26+4=30E: 6+8=14Mean turnaround time= (24+6+26+30+14)/5=100/5=20(c) FCFS10CDABE6248Turnaround time:A: 10B: 10+6=16C: 16+2=18D: 18+4=22E: 22+8=30Mean turnaround time= (10+16+18+22+30)/5=96/5=19.2(d) Shorted job first10CDABE6248Turnaround time:A: 2+4+6+8+10=30B: 2+4+6=12C: 2D: 2+4=6E: 2+4+6+8=20Mean turnaround time= (30+12+2+6+20)/5=70/5=1441. A soft real-time system has four periodic events with periods of 50, 100, 200, and 250 msec each. Suppose that the four events require 35, 20, 10, and x mse
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2030新型药物制剂技术突破深度解析与研发规划
- 2025-2030新型纺织材料产业发展分析及商业化实施方案与技术创新前景研究
- 2025-2030新型环保材料研发行业市场需求深度解析和未来发展规划研究报告
- 2025-2030新型环保包装材料市场开发现状分析产业投资规划前景研究
- 2025-2030新型涂料环保技术企业市场竞争态势发展评估
- 2025-2030新型显示技术行业市场发展全面研究及未来走向与资本运作策略研究报告
- 2025-2030新型建筑材料行业市场潜力研究及绿色建筑与节能政策链接分析报告
- 2025-2030新型家具材料环保技术发展市场现状分析投资机会规划研究
- 2026福建泉州晋江市安海镇梧山中心幼儿园后勤人员招聘备考题库及完整答案详解1套
- 2026贵州省应急管理厅直属事业单位招聘3人备考题库附参考答案详解(综合卷)
- 2026四川凉山州雷波县粮油贸易总公司面向社会招聘6人考试参考题库及答案解析
- 2024-2025学年广东省广州市越秀区九年级上学期期末数学试卷(含答案)
- 2026北京海淀初二上学期期末英语试卷和答案
- 多进制LDPC码编译码算法:从理论到硬件实现的深度剖析
- 2025年医院财务部工作总结及2026年工作计划
- 基于新课程标准的小学数学“教学评一致性”实践与研究课题开题报告
- 2026省考广西试题及答案
- 中国临床肿瘤学会(csco)乳腺癌诊疗指南2025
- 2025年(第十二届)输电技术大会:基于可重构智能表面(RIS)天线的相控阵无线通信技术及其在新型电力系统的应用
- 带压开仓培训课件
- 护理儿科中医题库及答案解析
评论
0/150
提交评论