欢迎来到天天文库
浏览记录
ID:42387569
大小:467.01 KB
页数:8页
时间:2019-09-14
《《操作系统教学资料》operatingsystemreviewproblems》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、OperatingSystemReviewProblems1.Whatisaprocess?PleasedrawaprocessstatetransitiondiagramwithninestatesinUnixSVR4?2.Illustratedsomescenarioswhereprocessswitchoccur?3.Supposetherearethreeprocessesrunninginanoperatingsystemwithmultithreadingasfollowing:ProcessIDThreadsAT11,T1
2、2BT21,T22CT31,T32Ifthemultithreadingissupportedbyuser-levelimplementationandthreadT11isblocked,whichthreadmaybescheduledtorunnext?Ifthemultithreadingissupportedbykernel-levelimplementation,whichthreadmaybescheduledtorunnext?4.Whatisracecondition?Giveaprogramimplementatio
3、ntodemonstratethemutualexclusionenforcedbyTestandSet(orexchange)instructionorbysemaphore?5.Considerthefollowingprogram:booleanblocked[2];intturn;voidP(intid){while(true){blocked[id]=true;while(turn!=id){while(blocked[1-id])/*donothing*/;turn=id;}/*criticalsection*/blocke
4、d[id]=false;/*remainder*/}}voidmain(){blocked[0]=false;blocked[1]=false;turn=0;parbegin(P(O),P(1));}Thissoftwaresegmentisthesolutiontothemutualexclusionproblemfortwoprocesses.Findacounterexample(反例)thatdemonstratesthatthissolutionisincorrect.考虑进程0执行到blocked[id]=true这个语句是
5、发生了进程切换,操作系统调度进程1运行。这种情况下会导致进程0和进程1同吋进入临界区。1.Giveasolutiontoboundedproducer-consumerproblemwithsemaphore・2.Whatisdeadlock?3.Bankeralgorithms?Safestate/unsafestate4.Addressmappinginpagingsystem:TheCPUsendsvirtualaddressestotheMMUCPUcardBusTheMMUsendsphysicaladdressestothe
6、memoryCachingdisabledModifiedPresent/absent1.WhatisTLB?11・Pagereplacementalgorithms(Optimal/LRU/FIFO/CLOCK)inpagingsystem.Pageaddressstream2321■2453252OPT222ZEs1i435435435235235235FFFLRU22工2工2-ya25252手35133FFFF222255553333FIFO33313121242424245452FFFF=pagefaultoccurringaf
7、tertheframeallocationisinitiallyfilledFigure8<15BehaviorofFourPage-ReplacementAlgorithmsLRU:■Replacesthepagethathasnotbeenrefereneedforthelongesttime■Bytheprincipleoflocality,thisshouldbethepageleastlikelytoberefereneedinthenearfuture■Eachpagecouldbetaggedwiththetimeofla
8、streference.ThiswouldrequireagreatdealofoverheadCLOCK:■Additionalbitcalledausebit■Whenapageisfirstloade
此文档下载收益归作者所有