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灯, 水草

请输入看板名称,例如:BabyMother 或 站内搜寻

TOP