




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
操作系統(tǒng)期中作業(yè)(答案)PAGEPAGE3操作系統(tǒng)期中作業(yè)姓名:___學(xué)號:專業(yè):一、Foreachofthefollowingstatements,ChoosingTrueorFalseBinarysemaphoresarethosethatareusedbynomorethantwothreads.FTheBanker'salgorithmisawayofpreventingdeadlock.FAmulti-levelindexedfilepermitsfasterrandomaccessthanacontiguouslyallocatedfile.FAnatomicoperationisamachineinstructionorasequenceofinstructionsthatmustbeexecutedtocompletionwithoutinterruption.TDeadlockisasituationinwhichtwoormoreprocesses(orthreads)arewaitingforaneventthatwilloccurinthefuture.FStarvationisasituationinwhichaprocessisdeniedaccesstoaresourcebecauseofthecompetitiveactivityofother,possiblyunrelated,processes.TWhileaprocessisblockedonasemaphore'squeue,itisengagedinbusywaiting.FMutualexclusioncanbeenforcedwithageneralsemaphorewhoseinitialvalueisgreaterthan1.FAprinterisanexampleofalogicalresource.FVersionsofOS/360arestillwidelyusedtoday.FWhenanexecutingprocessisstoppedbythescheduler,itissaidtobeblocked.FInterruptsareusedtoachieveatypicaltimesharingOS.T二、MultipleChoiceQuestionsForeachofthefollowingquestions,Thereisonlyonecorrectanswer.Whatisthepurposeofsystemcalls?a)Systemcallsallowuser-levelprocessestogainresourcesfromtheoperatingsystem.b)Systemcallsarethestandardinterfacebetweenauserprocessandakernelprocess.c)Systemcallsallowuser-levelprocessestorequestservicesoftheoperatingsystem.d)Thereisnorealpurposetosystemcalls.Threadsbelongingtothesameprocesssharethea)stack b)datasectionc)registerset d)threadIDInMany-to-Onethreadmodel,Whatwouldhappenifathreadinamultithreadedprocessmakesablockingsystemcall?a)theotherthreadsoftheprocesswouldcontinuetorunb)theentireprocesswouldgetblockedc)theblockingthreadwillgetkilledd)theblockingthreadwillnevergettorunagainWhichofthefollowingOperatingsystemsusespreemptivescheduling?a)MacOS8 b)Windows3.xc)Windows2000 d)DOS6.0Ameasureofthenumberofprocessescompletedpertimeunitiscalleda)throughput b)waitingtimec)responsetime d)CPUutilizationOneoftheproblemswithpriorityschedulingisa)aging b)starvationc)processdeath d)averagewaitingtimeInatime-sharingsystem,whichofthefollowingisthebestcriterionforCPUscheduling.a)MinimizeCPUutilization b)MaximizeCPUutilizationc)Maximizesystemthroughput d)Minimizeresponsetime.TheinitialvalueofsemaphoreSis2.ifthevalueis-1atpresent,howmanyprocessesareblockedonthissemaphore.a)1b)2c)3d)4Asystemisinadeadlock,ifitsresourceallocationgrapha)containsacycle b)doesn’tcontainacyclec)containsacycleandthereisjustoneinstanceofeveryresourced)hasatleastoneoutgoingedgefromanyoneoftheprocessnodesPreemptionofresourcescanbeenforcedtopreventoccurrenceofdeadlocks,butthiscan’tbeappliedtoalltheresourcetypes,aspreemptionmightleavetheresourceinanundeterminedstate.Whichofthefollowingresourcescan’thencebepreempted?a)CPUregisters b)memoryspacec)tapedrive d)alloftheaboveAsystemissaidtobe___________ifitcancontinuetofunctionevenwhenanodeornodesinthesystemfail.a)networked b)distributedc)realtime d)fault-tolerantWhichofthefollowingactivityneedsnospecialhardwaresupport?a)Processscheduling b)timermanagementc)memorymapping d)interruptsystemWhichofthefollowingstatementaboutprocessesisincorrect?a)Aprocessisdynamic.b)Aprocesshasalifetime.c)Aprocessisasetofinstructions.d)Multipleprocessesmayexecuteconcurrently.三、Considerthefollowingsetofprocesses:ProcessBurst-TimePriorityP1 15 4P2 3 8P3 7 5P4 5 2P5 1 6P6 2 6TheprocessesareassumedtohavearrivedintheorderP1,P2,P3,P4,P5,P6,allattime0.UseFCFS,SJF,RoundRobin(quantumis2),Priority(lownumbershavehighpriority).Foreachofthealgorithms:1DrawaGanttchart2.Whatistheaveragewaitingtimeforeachoftheschedulingalgorithms?3.Whatistheaverageturnaroundtimeforeachoftheschedulingalgorithms?Answer:FCFS: P1P2P3P4P5P6151825303133AWT=(0+15+18+25+30+31)/6=19.83ATT=(15+18+25+30+31+33)/6=25.33SJF:P5P6P2P4P3P1AWT=(18+3+11+6+0+1)/6=6.5ATT=(33+6+18+11+1+3)/6=12Round-Robin(quantum=2):P1P2P3P4P5P6P1P2P3P4P1P3P4P1P3P1AWT=(18+11+19+8+9)/6=13.83ATT=(33+14+26+23+9+11)/6=19.33Priority:P4P1P3P5P6P2AWT=(5+30+20+0+27+28)/6=18.33ATT=(20+33+27+5+28+30)/6=23.83Twoconcurrentprocesseshaveinput,computingandprintingactions,respectively.ThatissaidI1,C1,P1forthe1stprocess,andI2,C2,P2forthe2ndprocess.Theirprecedentialrelationshipisshowninthefigure,i.e.I2musthappenafterI1,C2musthappenafterC1andI2,etc.Pleasedescribethesynchronizationrelationshipoftwoprocessesbymeansofsemaphoresandrelatedwait/signaloperations.I1I1I2C1C2P1P2Semaphore:s1,s2,s3:=0;P1: P2: { { I1; wait(s1); signal(s1); I2 C1; wait(s2);signal(s2); C2 ;P1; wait(s3);signal(s3); P2;} }五、TherearethreecooperativeprocessesP1,P2,andP3.Theyreaddata,denotedasa、bandc,fromthesameinputdevice,asshowninfigurebelow.Theinputdeviceisanexclusiveaccessdevice.Thefirstdatum(a)mustbereadbyprocessP1,theseconddatum(b)isreadbyprocessP2,andthethirddatum(c)
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 住宅漏水修補(bǔ)施工合同范例
- 主機(jī)合同范例
- 2025版高中化學(xué)課時(shí)作業(yè)12烷烴含解析新人教版必修2
- 借用鋪面合同范例
- 企業(yè)花束合同范例
- 產(chǎn)品拍攝項(xiàng)目合同范例
- 事故二手車銷售合同范例
- 煙氣 CO2聚乙烯亞胺接枝纖維素納米管吸附機(jī)理的分子動(dòng)力學(xué)模擬
- 機(jī)械土石方施工方案
- 規(guī)則導(dǎo)向下花樣游泳集體技巧自選托舉動(dòng)作編排研究
- 2025年黑龍江職業(yè)學(xué)院單招職業(yè)適應(yīng)性測試題庫附答案
- 2025年四川三江招商集團(tuán)有限公司招聘筆試參考題庫含答案解析
- 2025高考數(shù)學(xué)一輪復(fù)習(xí)-第10章-第8節(jié) 二項(xiàng)分布、超幾何分布與正態(tài)分布【課件】
- 《心力衰竭護(hù)理》課件
- 內(nèi)保單位培訓(xùn)
- 早產(chǎn)兒與低出生體重兒袋鼠式護(hù)理技術(shù)規(guī)
- 進(jìn)化醫(yī)療-跨物種腫瘤基因治療的開拓者
- 法理學(xué)復(fù)習(xí)題+答案
- 信息化系統(tǒng)平臺試運(yùn)行方案
- 統(tǒng)編版(2024新版)七年級下冊道德與法治期末復(fù)習(xí)背誦知識點(diǎn)提綱
- 《田野調(diào)查方法》課件
評論
0/150
提交評論