5-第五章-习题及答案

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

5.2Discusshowthefollowingpairsofschedulingcriteriaconflictincertainsettings.a.CPUutilizationandresponsetimeb.Averageturnaroundtimeandmaximumwaitingtimec.I/OdeviceutilizationandCPUutilizationAnswer:a.CPUutilizationandresponsetime:CPUutilizationisincreasediftheoverheadsassociatedwithcontextswitchingisminimized.Thecontextswitchingoverheadscouldbeloweredbyperformingcontextswitchesinfrequently.Thiscouldhoweverresultinincreasingtheresponsetimeforprocesses.b.Averageturnaroundtimeandmaximumwaitingtime:Averageturnaroundtimeisminimizedbyexecutingtheshortesttasksfirst.Suchaschedulingpolicycouldhoweverstarvelong-runningtasksandtherebyincreasetheirwaitingtime.c.I/OdeviceutilizationandCPUutilization:CPUutilizationismaximizedbyrunninglong-runningCPU-boundtaskswithoutperformingcontextswitches.I/OdeviceutilizationismaximizedbyschedulingI/O-boundjobsassoonastheybecomereadytorun,therebyincurringtheoverheadsofcontextswitches.5.3ConsidertheexponentialaverageformulausedtopredictthelengthofthenextCPUburst.Whataretheimplicationsofassigningthefollowingvaluestotheparametersusedbythealgorithm?a.α=0andτ0=100millisecondsb.α=0.99andτ0=10millisecondsAnswer:α=0andτ0=100milliseconds,theformulaalwaysmakesapredictionof100millisecondsforthenextCPUburst.Whenα=0.99andτ0=10milliseconds,themostrecentbehavioroftheprocessisgivenmuchhigherweightthanthepasthistoryassociatedwiththeprocess.Consequently,theschedulingalgorithmisalmostmemory-less,andsimplypredictsthelengthofthepreviousburstforthenextquantumofCPUexecution.5.9Considerapreemptivepriorityschedulingalgorithmbasedondynamicallychangingpriorities.Largerprioritynumbersimplyhigherpriority.WhenaprocessiswaitingfortheCPU(inthereadyqueue,butnotrunning),itsprioritychangesatarateα;whenitisrunning,itsprioritychangesatarateβ.Allprocessesaregivenapriorityof0whentheyenterthereadyqueue.Theparametersαandβcanbesettogivemanydifferentschedulingalgorithms.a.Whatisthealgorithmthatresultsfromβ>α0?b.Whatisthealgorithmthatresultsfromαβ0?Answer:a.FCFSb.LIFO

1 / 1
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功