您好,欢迎访问三七文档
当前位置:首页 > 医学/心理学 > 药学 > 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
本文标题:5-第五章-习题及答案
链接地址:https://www.777doc.com/doc-7208180 .html