Grad-ProbAsk 板


LINE

※ 引述《SiriusCloud (古月小枫)》之铭言: : 标题: Re: [理工] [OS] scheduling : 时间: Sat Oct 15 01:10:22 2011 : : ※ 引述《ceo890710 (Drinking)》之铭言: : : 恐龙的习题 : : Consider a system running ten IO-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 tasks 10 : : milliseconds to complete.Also assume that the context-switching overhead : : is 0.1 millisecond and that all processes are long-running tasks. Describe : : the CPU utilization for a round-robin scheduler when: : : a. The time quantum is 1 millisecond : : b. .. .. .. .. 10 millisecond : : 不太懂这题的意思 请问怎麽算.. : : : a. 假设原本做完是100% utilization : 现在花了0.1 ms 去做context switching : 因为 time quantum 是 1 ms : 所以 CPU utilization 是--------> 1 / (1 + 0.1) = 91 % : : b. 现在 time quantum 变成 10 ms : I/O bound 最多 花 1ms : 每 1 ms 发生一次 context switching : 加上 I/O 完成 要花 10 ms 又会再发生一次 context switching : 因此 这边我认为是I/O bound使用CPU的时间加上 CPU bound使用cpu的时间 跟I/O完成无关 : I/O + I/O完成 I/O做完10ms後换成CPU + 1次 context switching : ^^^^^^^^ ^^^^ : (10 + 10) / (10 * 1.1) + 10.1 = 94% : ^^^^^^^^^^^^ : I/O 每 1 ms发生一次 context switching : : 推 ceo890710:想请问第二题 为什麽I/O完成也要再多10呢.. 10/15 08:49 : → ceo890710:另外~这是以一次I/O工作来讨论的吗? 因为他有10个I/O 10/15 08:50 我的想法跟S大不一样,我的作法是不管I/O完成的时间 只要在I/O bound task下一次分配到time quantum的时候 他自身issue的I/O operation已经处理完,不会使得此task还在等待就好 如此下次轮到此task,又会再issue一个IO operation,於是又要context switching 因为总共有10个IO bound跟1个CPU bound tasks 每个IO bound task 只要处理1ms,就会因需要等待I/O operation 而context switching到其他的task 也就是说每个I/O bound task的cpu utilization是1/1.1 而cpu bound task则是 10/10.1 (这应该没问题) 换句话说以各任务分配到一个quantum来说,总共是10+10/10*1.1 + 10.1 然後题目有提到这些都是long-running tasks,就当作他们做不完吧XD 所以之後第二轮的执行还是跟第一轮一样 因此cpu utilization还是如同之前算的 就跟第一题一样的道理 第一题无论如何,每个quantum都是1/1.1 所以在此cpu scheduling之下, cpu utilization就是1/1.1 至於题目为什麽要给10个I/O bound跟1个 cpu bound 吃饱没事想了一下 因为每个I/O operation需要10 ms处理 所以若是没有另外9+1个 tasks 吃掉时间 则在第一题,I/O bound task等到下次轮到他的time quantum时 会因为还在等待I/O operation的处理导致他直接跳过 这样搞下去CPU utilization应该会很难算... 这是我想的啦,也不知道有没有错 大家讨论一下吧! --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.27.250.59
1F:推 ceo890710:我之前的方向想错了..如果是这样那我懂了~谢谢!! 10/15 22:30







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:e-shopping站内搜寻

TOP