下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026秋新版小学二年级数学暑假脱式计算专项作业(含答案)
- 综合能源社会化投资合作项目文明施工措施
- 2025山东佛士特环保处置有限公司招聘15人笔试历年典型考点题库附带答案详解
- 2025安徽蚌埠市龙子湖区产业发展有限公司招聘22人笔试历年备考题库附带答案详解
- 2025宁夏贺兰山国家森林公园有限公司招募见习岗位人员11名笔试历年难易错考点试卷带答案解析
- 2025天津地铁综合站务员招聘笔试历年备考题库附带答案详解
- 2025国家电投集团江西公司招聘3人笔试历年难易错考点试卷带答案解析
- 2025四川长虹教育科技有限公司招聘技术支持岗位1人笔试历年常考点试题专练附带答案详解
- 2025四川绵阳市建设工程质量检测中心有限责任公司市场部业务拓展员岗招聘1人笔试历年备考题库附带答案详解
- 2025四川成都产业投资集团有限公司所属公司招聘运营经理等岗位20人笔试历年难易错考点试卷带答案解析
- (2026)全国应急管理普法知识竞赛试题库及答案
- 2026年河南省中考真题道德与法治试卷和答案
- 2026中国航空发动机集团总部招聘36人笔试备考题库及答案详解
- 2026年全国通信专业技术人员考试高、中级(通信专业实务终端与业务)模拟试题及答案
- 2026年初二物理基础测试题及答案
- 防灾减灾安全知识普及课件
- 建筑材料检测送检指南(机电类)
- 平台防腐施工方案(3篇)
- 北京市第四中学2026届高一数学第二学期期末联考试题含解析
- 2025年国控私募基金招聘笔试题库及答案汇编
- 2025年消防员历年面试题及答案
评论
0/150
提交评论