FCUProblems 板


LINE

※ [本文轉錄自 FCU_Talk 看板] 作者: justforppt (洨麵人) 看板: FCU_Talk 標題: [考古][資訊][林明言][97年上期末][作業系統][OS(一)] 時間: Wed Jan 14 13:40:30 2009 考完時間太多..來打個考古題..順便練英打= = PART 1. 1. Belady's Anomaly states that ______ (A)giving more memory to process will improve its performance. (B)as the number of allocated frames increases,the page-fault rate may decrease for all page replacement algorithms. (C)for some page replacement algorithms,the page-fault rate may decrease as the number of allocated frames increase. (D)for some page replacement algorithms,the page-fault rate may increase as the number of allocated frames increase. 2. Which of the following situation may indicate that the system is thrashing? (A)CPU utilization 78%,Paging Disk utilization 78% (B)CPU utilization 22%,Paging Disk utilization 78% (C)CPU utilization 22%,Paging Disk utilization 22% (D)CPU utilization 78%,Paging Disk utilization 22% 3. Which of the following dynamic storage-allocation algorithms in the smallest leftover hole in memory? (A)best-fit (B)worst-fit (C)first-fit (D)None 4. Which of the following binding schemes facilitates deadlocks? (A)execution time (B)load time (C)assembly time (D)interrupt time 5. Which of the following is a way to deal with deadlocks? (A)ensure that a system will never enter a deadlocked? (B)allow the system to enter a deadlocked state and then detect and recover (C)ignore the deadlock altogether (D)all of the above 6. A cycle in a resource-allocation graph is_____ (A)a necessary and sufficient condition for deadlock in the case that each resource has more than one instance. (B)a necessary and sufficient condition for a deadlock in the case that each resource exactly one instance. (C)a sufficient condition for a deadlock in the case that each resource has more than one instance. (D)is neither necessary nor sufficient for indicating deadlock in the case that each resource exactly one instance. 7. In a system resource-allocation graph,_____. (A)a directed edge from a process to a resource is called an assignment edge. (B)a directed edge from a resource to a process is called a request edge. (C)a directed edge from a process to a resource is called a request edge. (D)none of the above. 8. A semaphore __. (A)is essentially an integer variable. (B)is accessed through only one standard operation. (C)can be modified simultaneously by multiple threads. (D)cannot be used to control access to a thread's critical sections. 9. The first readers-writers problem____. (A) request that,once a writer is ready,that writer performs its write as soon as possible. (B) is not used to test synchronization primitives. (C) request that no reader will be kept waiting unless a writer has already obtained permission to use the shared database. (D) request that no reader will be kept waiting unless a reader has already obtained permission to use the shared database. 10. A transaction____ (A)performs multiple logical functions. (B)is a single instrutuon. (C)is a single operation (D)performs a single logical function PART II:short answers(簡答) 1. (a) List,except progress the other two criteria that a critical section solution must satisfy. (b) Briefly describe their meanings. 2. In Peterson's solution for two cooperating processes, (a)what variable are shared between the two processes? (b)what is the "entry code" before entering the critical section? (c)what is the "exit code" before leaving the critical section? 3. If 3 processes P1,P2,and P3,are cooperating for a task.Function p1a()(P1), function p2b(P2),and funtion p3c(P3) are tk be exechted in this order: p1a() can be executed after p2b() has finished. p3c() can be executed after p1a() has finished. Present a pseudocode using semaphore to show these processes,indicate the necessary semaphores and their initial values. 4.If a system prevents deadlock by guaranteeing the following constraint: whenever a process requests a resource,it does not hold any other resource (a)give two protocols to implement this provision (b)name two disadvantages for these protocols. 5. There are two methods for a system to elimminat deadlocks by aborting a process. (a)briefly describe the two methods (b) which method will invoke a deadlock-detection algorithm? 6.(a)Draw the resorce-allocation graph for the following situation:P = {P1, P2,P3},R = {R1,R2,R3}, E = {P1→R1,R1→P2,R1→P3,P3→R2,R2→P1,R3→P3} R1 has two instances,R2 has one instance,and R3 has one instance (b)List the deadlocked processes if there is a deadlock OR describe how the system can be free from a deadlock. 7. Consider a locgical address space of 16 pages of 2048 words each,mapped onto a physical memory of 64 frames. (a)How many bits are there in the logical address? (b)How many bits are there in the physical address? 8. (a) Explain the difference between internal and external fragmentation. (b) Withoust paging how do you reduce external fragmentation? 9. Consider a paging system with the page table stored in memory. (a)If a memory reference takes 100 nanosecnds,how long does paged memory referende take? (b)if we add associative registers and finding a page-table entry in the associative registers takes 20 nanoseconds, what is the minimum hit-ratio for the TLB if effective memory accse time must be less than 140 nanoseconds? 10.(a)What are the three techniques for structuring the page tables? (b)which technique needs a linked list and why? 11. Using demand paging,what benefits bo you have? 12. Describe the 6 steps to handle a page fault. PART III:(計算/簡答) 1.Given 3 frams and the following referene string(4,3,2,1,4,3,5,4,3,2,1,5) for page replacement. (a)what is the minimum number of page faults? (b)using LRU page-replacement scheme,how many page faults do you have? (c)using FIFO page-replacement scheme,how many page faults do you have? 2.Use the banker's algorithm and consider the following snapashot of a system Allocation Max Available A B C D A B C D A B C D P0 0 0 1 2 0 0 1 2 1 5 2 0 P1 1 0 0 0 1 7 5 0 P3 1 3 5 4 2 3 5 6 P4 0 6 3 2 0 6 5 2 P5 0 0 1 4 0 6 5 6 (a)what is the content of the matrix Need? (b)Is the in a safe state,and why? (c)if a request from process P1 arrives for(0,4,2,0),can the request be granted immediately,and why? 3.A system uses demand-paging:its page fault rate is 0.005,memory access time 80 nanoseconds,a service to handling a page fault take 20 milliseconds in average,swapping a page needs 2 milliseconds, the time to restart an instruction can be ignored. Compute effecitve access time: (a) if memory has free frame (b) if memory has no free frame 4.Consider the bounded-buffer problem (size n) using semaphore solution. Complete the following structures of producer/consumer processes. Semaphores mutex,empty,full are used. (a) producer process (b) consumer process do{... do{... ___________ ___________ ___________ ___________ .... // add to buf ...//remove item from buf ___________ ___________ ___________ ___________ }while(true) }while(true) (c)what are the initial values for mutex,empty,full? 5.Explain"two - phase locking protocol" 6.Compare "Buddy system" and "Slab allocation" -- 原po尬正妹,迸出新滋味,全新科科良品,復古味,新絕配! http://www.wretch.cc/blog/lulu168 --



※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.46.151.138
1F:推 u06xjp6:不推不行,辛苦了 01/14 14:01
2F:推 ivansailu:好人! (遞卡) 01/14 14:08
3F:推 GDs:題目有夠多寫到手酸~"~ 01/14 15:08
4F:推 a761007:推 01/14 15:35
5F:推 sklogn:老師是好人!! 01/14 15:43
--



※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.214.27







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:e-shopping 或 站內搜尋

TOP