下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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广东云浮市应急管理局遴选公务员3人备考题库附答案
- 2025广西铝业集团有限公司社会招聘18人模拟试卷附答案
- 2025年河北邢台市公安局招聘劳务派遣警务辅助人员50名(公共基础知识)综合能力测试题附答案
- 2025安徽铜陵市人力资源和社会保障局选调事业单位人员2人备考题库附答案
- 新年主题班会内容规划【演示文档课件】
- 2026年广西机电职业技术学院高职单招职业适应性测试备考试题有答案解析
- 2026内蒙古鄂尔多斯市伊金霍洛旗公立医院招聘专业技术人员90人笔试模拟试题及答案解析
- 2026年甘肃陇南成县招聘城镇公益性岗位人员42人笔试模拟试题及答案解析
- 2026湖南长沙市麓山高岭实验学校春公开招聘小学语文、数学教师笔试模拟试题及答案解析
- 2025南平武夷新区业务部门招聘3人笔试参考题库及答案解析
- 联合培养研究生协议
- 虚拟电厂课件
- 部队核生化防护基础课件
- 医疗器械胰岛素泵市场可行性分析报告
- 2025年《处方管理办法》培训考核试题(附答案)
- 租金催缴管理办法
- 种植业合作社账务处理
- JJF 2266-2025血液融浆机校准规范
- 公司两权分离管理制度
- 紫砂陶制品行业深度研究分析报告(2024-2030版)
- 餐饮公司监控管理制度
评论
0/150
提交评论