資源描述:
《政企大客戶(hù)營(yíng)銷(xiāo)技巧培訓(xùn)》由會(huì)員上傳分享,免費(fèi)在線(xiàn)閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、ModernOperatingSystemsChapter2–Process&ThreadZhangYangSpring20132.1Processes2.2ThreadsContentofthislecture2.1Processes2.2ThreadsModernWorkstationsandPCsMultiplewindowsinpersonalcomputerdoingcompletelyindependentthingsWord,Excel,Photoshop,E-mail,music,etc
2、.MultipleactivitieswithinoneapplicationE.g.,inMicrosoftWordReadingandinterpretingkeystrokesFormattinglineandpagebreaksDisplayingwhatyoutypedSpellcheckingHyphenation….WhenthereisasingleprogramrunningintheCPU,itleadstothedegradationoftheCPUutilization.Exam
3、ple:WhenarunningprograminitiatesanI/Ooperation,theCPUremainidleuntiltheI/Ooperationiscompleted.SolutiontothisproblemisprovidedbyMultiprogramming.Multiprogramming(1)DefinitionAmodeofoperationthatprovidesfortheinterleavedexecutionoftwoormoreprogramsbyasing
4、leprocessor.ImprovingCPUutilizationByallowingseveralprogramstoresideinmainmemoryatthe“sametime”theCPUmightbeshared,suchthatwhenoneprograminitiatesanI/Ooperation,anotherprogramcanbeassignedtotheCPU,thustheimprovementoftheCPUutilization.Multiprogramming(2)
5、AllowsmultipleapplicationstorunatthesametimeExampleInsequentialenvironment,Aexecutesfirst,thenB.Concurrency(1)Example(ctd.)ConcurrencyConcurrency(2)ABCPUDEV1DEV1CPU10152025CPUDEV2CPU3035DEV24045CPUDEV2BenefitsofConcurrencyWhatarethelimitationswithoutconc
6、urrency?LongresponsetimeResourcesunderutilizedBetterresourceutilizationResourcesunusedbyoneapplicationcanbeusedbytheothersBetteraverageresponsetimeNoneedtowaitforotherapplicationstocompleteIssuesrelatedtoconcurrencyItiseasiertodoonethingatatime.Problemsw
7、ithdoingmultiplethings:ApplicationsneedtobeprotectedfromoneanotherAdditionalcoordinationmechanismsamongapplicationsOverheadtoswitchamongapplicationsPotentialperformancedegradationwhenrunningtoomanyapplicationsUsers,Programs,ProcessesUsershaveaccountsonth
8、esystemUserslaunchprogramsManyusersmaylaunchsameprogramOneusermaylaunchmanyinstancesofthesameprogramTheprocessisanOSabstractionforarunningprogramProcess:anexecutingprogramProcessesareinstancesofaprogramThe“program”canreall