《操作系统教学资料》operatingsystemreviewproblems

《操作系统教学资料》operatingsystemreviewproblems

ID:42387569

大小:467.01 KB

页数:8页

时间:2019-09-14

《操作系统教学资料》operatingsystemreviewproblems_第1页
《操作系统教学资料》operatingsystemreviewproblems_第2页
《操作系统教学资料》operatingsystemreviewproblems_第3页
《操作系统教学资料》operatingsystemreviewproblems_第4页
《操作系统教学资料》operatingsystemreviewproblems_第5页
资源描述:

《《操作系统教学资料》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

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。