/
CHAPTER CPU Scheduling Practice Exercises CHAPTER CPU Scheduling Practice Exercises

CHAPTER CPU Scheduling Practice Exercises - PDF document

danika-pritchard
danika-pritchard . @danika-pritchard
Follow
579 views
Uploaded On 2015-01-17

CHAPTER CPU Scheduling Practice Exercises - PPT Presentation

1 CPU scheduling algorithm determines an order for the execution of its scheduled processes Given processes to be scheduled on one processor how many different schedules are possible Give a formula in terms of n Answer n factorial 1 2 1 62 Exp ID: 32580

CPU scheduling algorithm determines

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "CHAPTER CPU Scheduling Practice Exercise..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

CPUSchedulingPracticeExercises-schedulingalgorithmdeterminesanorderfortheexecutionofitsscheduledprocesses.Givenprocessestobescheduledononeprocessor,howmanydifferentschedulesarepossible?Giveaformulaintermsof 0.080.441.01a.Whatistheaverageturnaroundtimefortheseprocesseswiththeschedulingalgorithm?b.Whatistheaverageturnaroundtimefortheseprocesseswiththeschedulingalgorithm?c.Thealgorithmissupposedtoimproveperformance,butnoticethatwechosetorunprocessattime0becausewedidnotknow Chapter6CPUSchedulingthattwoshorterprocesseswouldarrivesoon.Computewhattheaverageturnaroundtimewillbeiftheisleftidlefortherst1unitandthenschedulingisused.Rememberthatprocessesarewaitingduringthisidletime,sotheirwaitingtimemayincrease.Thisalgorithmcouldbeknownasfuture-knowledgea.10.53b.9.53c.6.86Rememberthatturnaroundtimeisnishingtimeminusarrivaltime,soyouhavetosubtractthearrivaltimestocomputetheturnaroundtimes.is11ifyouforgettosubtractarrivaltime.Whatadvantageisthereinhavingdifferenttime-quantumsizesatdifferentlevelsofamultilevelqueueingsystem?Processesthatneedmorefrequentservicing,forinstance,interactiveprocessessuchaseditors,canbeinaqueuewithasmalltimequantum.Processeswithnoneedforfrequentservicingcanbeinaqueuewithalargerquantum,requiringfewercontextswitchestocompletetheprocessing,andthusmakingmoreefcientuseofthecomputer.-schedulingalgorithmsareparameterized.Forexample,thealgorithmrequiresaparametertoindicatethetimeslice.Multilevelfeedbackqueuesrequireparameterstodenethenumberofqueues,theschedulingalgorithmsforeachqueue,thecriteriausedtomoveprocessesbetweenqueues,andsoon.Thesealgorithmsarethusreallysetsofalgorithms(forexample,thesetofalgorithmsforalltimeslices,andsoon).Onesetofalgorithmsmayincludeanother(forexample,thealgorithmisthewithaninnitetimequantum).What(ifany)relationholdsbetweenthefollowingpairsofalgorithmsets?a.Priorityandb.Multilevelfeedbackqueuesandc.Priorityanda.Theshortestjobhasthehighestpriority.b.Thelowestlevelofgivesthehighestprioritytothejobhavingbeeninexistencethelongest.d.None. PracticeExercisesSupposethataschedulingalgorithm(atthelevelofshort-termscheduling)favorsthoseprocessesthathaveusedtheleastprocessortimeintherecentpast.WhywillthisalgorithmfavorI/Oprogramsandyetnotpermanentlystarve-boundprograms?ItwillfavortheI/O-boundprogramsbecauseoftherelativelyshortburstrequestbythem;however,the-boundprogramswillnotstarvebecausetheI/O-boundprogramswillrelinquishtherelativelyoftentodotheirI/ODistinguishbetweenschedulingisdonelocaltotheprocess.ItishowthethreadlibraryschedulesthreadsontoavailableLWPschedulingisthesituationwheretheoperatingsystemscheduleskernelthreads.Onsystemsusingeithermany-to-oneormany-to-many,thetwoschedulingmodelsarefundamentallydifferent.Onsystemsusingone-to-one,arethesame.Assumethatanoperatingsystemmapsuser-levelthreadstothekernelusingthemany-to-manymodelandthatthemappingisdonethroughtheuseofLWPs.Furthermore,thesystemallowsprogramdeveloperstocreatereal-timethreads.Isitnecessarytobindareal-timethreadtoanLWPYes,otherwiseauserthreadmayhavetocompeteforanavailableLWPpriortobeingactuallyscheduled.BybindingtheuserthreadtoanLWPthereisnolatencywhilewaitingforanavailableLWP;thereal-timeuserthreadcanbescheduledimmediately.Thetraditionalschedulerenforcesaninverserelationshipbetweenprioritynumbersandpriorities:thehigherthenumber,thelowerthepriority.Theschedulerrecalculatesprocessprioritiesoncepersecondusingthefollowingfunction:Priority=(recentusage/2)+basewherebase=60andrecentreferstoavalueindicatinghowoftenaprocesshasusedthesinceprioritieswerelastrecalculated.Assumethatrecentusageforprocessis40,forprocessis18,andforprocessis10.Whatwillbethenewprioritiesforthesethreeprocesseswhenprioritiesarerecalculated?Basedonthisinformation,doesthetraditionalschedulerraiseorlowertherelativepriorityofa-boundprocess?Theprioritiesassignedtotheprocessesare80,69,and65respectively.Theschedulerlowerstherelativepriorityof-boundprocesses.