2JOB PROCESS AND THREAD.pptx
- 文档编号:18714545
- 上传时间:2023-10-17
- 格式:PPTX
- 页数:82
- 大小:952.82KB
2JOB PROCESS AND THREAD.pptx
《2JOB PROCESS AND THREAD.pptx》由会员分享,可在线阅读,更多相关《2JOB PROCESS AND THREAD.pptx(82页珍藏版)》请在冰点文库上搜索。
CHAPRE2:
JOB、PROCESSANDTHREAD,LImei-an,JOBPROCESSANDTHREAD,1.JOB2.PROCESS3.TREAD,1.JOB,OS,BARECOMPUTER,USER,HowtodealtheSchedulabilitymultiprogrammingSystem,VM(virtualmachine),JOB1,JOB2,JOB3,1.JOB,CharacteristicsofmultiprogrammingOS,Multiprocessing(多道性)Schedulability(调度性,异步性)Non-Reproducibility(不可再现性),1.JOB,DISCUSSION1)Howtoavoidtheinteractionsofmanyjobsinthememoryofacomputer.2)Whatswayscanusedtooperatethejobincomputer?
1.JOB,IntroduceJCB(JobControlBlock,adata-structure)intoJOBMANAGEMENTConsiderofthestructureanditemsofJCB(shouldconsidertheindependence,performance,scheduleinformationandsoon),1.JOB,JobIdentifierJobNameUserAccount(用户帐户)InformationofSchedulingResourceRequirementJobStatusAddressofInputWellAddressofOutputWellAddressofJob,THESTRUCTUREOFJCB,1.JOB,TimeofLog-inTimeofJobstartTimeofJobFinishTimeofJobQuitResourcePerformanceDISCUSSIONWhydoestheJCBincludeaddressindex?
WhydoestheJCBincludetimeindex?
THESTRUCTUREOFJCB,1.JOB,DISCUSSIONHowmanystatusofjob?
THESTATUSOFJCB,1.JOB,ExecutingStateReadystateI/OState,THESTATUSOFJCB,1.JOB,ExecutingStateReadystateI/OState,THECONTROLOFJCB,ExecutingState,I/OState,Readystate,Executingfinished,scheduling,I/Orequest,I/Orequest,I/Ofinished,JOB,JOBisaprogramentityinmemorythathasaindependentlogicmeaningandcanoperateincomputer,JOB,JCB+PROGRAM+DATA,JOBENTITY,2.PROCESS,CharacteristicsofTime-sharedOS,Multipathing(多路性)Independence(独立性)Timeliness(及时性)Interactivity(交互性),2.PROCESS,DISCUSSIONFromJCB,trytogetthestructureanditemsofPCB,2.PROCESS,ProcessIdentifier;CurrentStatus;AddressofProgramandData;BillofResourceRequirement;PriorityCPUstatus(CPU现场保护区);MechanismofSynchronization(同步)andCommunication(通信),THESTRUCTUREOFPCB,2.PROCESS,NextPCBPointer;OtherMessages.DISCUSSIONWhereoftimeindex?
Howtoensuretheindependenceoftheprocessesinonecomputer?
BasethePCBstructure,howtoorganizeallPCBsinmemory?
THESTRUCTUREOFPCB,2.PROCESS,LinkIndex,ORGANISINGOFPCB,LINKQUEUEOFPCB,INDEXOFPCB,PROCESS,PCB+PROGRAM+DATA,PROCESSENTITY,Entityofprocess,PROCESS,PROCESSistherunningprocessofaprocessentity.Itsaindependentbasicunitofoperationandresourcerequestincomputer.,Definitionofprocess,2.PROCESS,DISCUSSIONThemodelsofthejobsandprocessesincomputer.Howtoconstructthejobentity(作业实体)andprocessentity(进程实体)?
Howmanystatustoaprocess?
STATUSOFPROCESS,2.PROCESS,Twostatusmodel,BASICSTATUSOFPROCESS,Executing,Non-Executing,Finished,Scheduling,2.PROCESS,Threestatusmodel,BASICSTATUSOFPROCESS,Executing,Ready,Block,Scheduling,TimesliceExhaust,I/ORequest,I/OFinished,2.PROCESS,Firstextendedfivestatusmodel,EXTENDEDSTATUSOFPROCESS,Executing,Ready,Block,Scheduling,TimesliceExhaust,I/ORequest,I/OFinished,Creation,Permission,Termination,ProcessFinished,2.PROCESS,Secondextendedfivestatusmodel,EXTENDEDSTATUSOFPROCESS,IntroduceSuspendedModeinStatusofProcess,Executing,StaticReady,ActiveReady,StaticBlock,ActiveBlock,Suspended,Release,Suspended,Active,Release,Active,Suspended,I/ORequest,Scheduling,2.PROCESS,Extendedsevenstatusmodel,EXTENDEDSTATUSOFPROCESS,SevenStatusModelofProcess,Executing,StaticReady,ActiveReady,StaticBlock,ActiveBlock,Suspended,Release,Suspended,Active,Release,Active,Suspended,I/ORequest,Termination,Creation,ProcessFinished,Permission,Scheduling,2.PROCESS,EventsMakeProcessStatusTranslation,CONTROLPROCESS,SevenStatusModelofProcess,Executing,StaticReady,ActiveReady,StaticBlock,ActiveBlock,Suspended,Release(wakeup),Suspended,Active,Release(wakeup),Active,Suspended,I/ORequest(block),Termination,Creation,ProcessFinished,Permission,Creation,Termination,Scheduling,2.PROCESS,EventsMakeProcessStatusTranslationCreationandTermination;BlockandWakeup;SuspendedandActive;Scheduling.,2.PROCESS,CreationWhocancreateaprocess?
ParentprocessUserlog-inJobschedulingHowtocreateaprocess?
EmptyPCBrequestResourceallocationInitiatePCBInsertPCBtoreadyqueue,CreationandTermination,Processtree,2.PROCESS,TerminationWhocanterminateaprocess?
ParentprocessUserquitnormalendandabnormalendHowtoterminateaprocess?
SearchPCBChangethestatusoftheprocessReleaseresourceKeepaccounts,CreationandTermination,2.PROCESS,BlockWhocanblockaprocess?
Servicerequest(suchasI/Orequest)synchronization(suchaswaitingforadata)Howtoblockaprocess?
CallforaPrimitive(原语suchasblockprimitive)ChangethestatusoftheprocessInserttheblockprocesstoblockqueue,BlockandWakeup,2.PROCESS,WakeupWhocanwakeupaprocess?
FinishedtheServicerequestorsynchronizationHowtowakeupaprocess?
CallforaPrimitive(原语suchaswakeupprimitive)ChangethestatusoftheprocessInserttheblockprocesstoreadyqueue,BlockandWakeup,2.PROCESS,SuspendedWhocansuspendedaprocess?
UserrequestOSrequestHowtosuspendedaprocess?
ChangethestatusoftheprocessPlacePCBinspecifiedarea(特定区域),SuspendedandActive,2.PROCESS,ActiveWhocanactiveaprocess?
UserrequestOSrequestHowtoactiveaprocess?
Reconstructtheprocessentity(进程实体)ChangethestatusoftheprocessInserttheprocesstocorrespondingqueue,SuspendedandActive,2.PROCESS,Whocanscheduleaprocess?
SystemHowtoscheduleaprocess?
Searchallreadyprocesses;RunningschedulingalgorithmtodeterminewhichprocessshouldbedispatchedCPU;Changethestatusofthisprocess;DispatchCPUtothisprocess.,Scheduling,2.PROCESS,SchedulingandSchedulingalgorithmSchedulingistodeterminetheorderofusingacertainresourcebasedonsomestrategy(策略)SchedulingalgorithmisthemethodorstrategyusedtodeterminetheorderofusingacertainresourcemodesofdispatchingCPUPreemptiveModeNon-PreemptiveMode,Scheduling,2.PROCESS,ClassificationofschedulingJobschedulingProcessschedulingStaticprocessscheduling(Activestaticprocess,激活挂起进程,中程调度),Scheduling,2.PROCESS,JobschedulingCallJobschedulingaslong-distanceschedulingorhigh-levelschedulingJobschedulingschedulejobfromexternalstoragetomemory,thencreateaprocessforthisjobandinsertthisprocesstothereadyqueue.,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingThetimeindexofjobscheduling
(1)Turnaroundtime(周转时间)turnaroundtimetimeofquit-timeoflog-inWaitingtimeinexternalstorageWaitingtimeinreadyqueueExecutingtimeWaitingtimeofI/O,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingThetimeindexofjobschedulingExampleAjobarrivestimeis5,entermemorytimeis8;firststarttoexecutingtimeis15,finishedtimeis18;secondstarttoexecutingtimeis30,finishedtimeis31,finishedtimeofI/Ois36;thirdstarttoexecutingtimeis45,finishedtimeis46,finishedtimeofI/Ois54,quit.Solvetheturnaroundtime,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingThetimeindexofjobscheduling
(2)Averageturnaroundtime(平均周转时间)ExampleAcomputerstarttooperateat9:
00AM,andendoperationat12:
00AM.Inallthistime,2326jobshavebeenfinished.SolvetheAverageturnaroundtime.,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingThetimeindexofjobscheduling(3)Systemservicetime(系统服务时间)CallthetimecostoftheCPUexecutingajobasthesystemservicetimeofthisjob(4)Weightedaverageturnaroundtime(带权平均周转时间)AssumeTistheturnaroundtimeofajob,TSisthesystemservicetimeofthisjob.DefineW=T/TSistheweightedturnaroundtimeofthisjobIftherearenjobs,defineItistheaverageweightedturnaroundtimeofthesenjobs,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingFCFS(FIFO)algorithm:
FirstComeFirstServiceTheCPUusedorderbasedonthearrivesequence,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingFCFS(FIFO)algorithm:
firstcomefirstserviceTheCPUusedorderbasedonthearrivesequence,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingFCFS(FIFO)algorithmExercise,Scheduling-Jobscheduling,2.PROCESS,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingSJFalgorithm:
ShortestJobFirstTheCPUusedorderbasedonthesystemservicetimeExample,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingSJFalgorithm:
ShortestJobFirstTheCPUusedorderbasedonthesystemservicetimeExample,Scheduling-Jobscheduling,2.PROCESS,AlgorithmofjobschedulingSJFalgorithm:
shortestjobfirstTheCPUusedorderbasedonthesystemservicetimeExercise,Scheduling-Jobscheduling,2.PROCESS,Scheduling-Jobscheduling,2.PROCESS,Scheduling-processscheduling,ProcessschedulingProcessschedulingistodeterminewhichprocessinreadyqueuewillgetCPUanddispatchCPUtothisprocess.Callprocessschedulingasshort-distanceschedulingorlow-levelscheduling,2.PROCESS,Scheduling-processscheduling,ProcessschedulingalgorithmPriorityItsanumber.ThisnumberisdeterminedbysystemandwillbethebasisofprocessschedulingThebasisofdeterminingtheprioritylistasfallow:
ThetypeofprocessResourcerequirementofprocessUserdemandClassthepriorityofprocessintotwotypes:
StaticpriorityDynamicpriority,2.PROCESS,Scheduling-processscheduling,Processschedulingalgorithm
(1)Highestpriorityfirstalgorithm(HPF)1)Highresponseratiofirstalgorithm(HRRF)Definewaitingtime+servicetimeasresponsetimeDefineresponseratioas(responsetime)/(servicetime),2.PROCESS,Highresponseratiofirstalgorithm(HRRF),Example,2.PROCESS,Scheduling-processscheduling,Exercise,2.PROCESS,Scheduling-processscheduling,2.PROCESS,Scheduling-processscheduling,Processschedulingalgorithm2)Roundtime-slicealgorithm(HPF)3)Multi-levelfeedbackqueuealgorithm,2.PROCESS,Scheduling-processscheduling,Processschedulingalgorithm
(2)Real-Timeschedulingalgorithm(RTSA)1)Earliest-DeadlineFirst(EDF)(最早开始截止时间优先),Giventhelaststartdeadline,2.PROCESS,Scheduling-processsch
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2JOB PROCESS AND THREAD JOB
![提示](https://static.bingdoc.com/images/bang_tan.gif)