b04902xxx 板


LINE

※ [本文转录自 NTU-Exam 看板 #1KZIjikr ] 作者: rod24574575 (天然呆) 看板: NTU-Exam 标题: [试题] 101下 郭大维 作业系统 期中考+解答 时间: Sun Dec 14 14:17:14 2014 课程名称︰作业系统 课程性质︰必修 课程教师︰郭大维 开课学院:电资学院 开课系所︰资工系 考试日期(年月日)︰ 考试时限(分钟):180 试题 : Operating Systems Mid-Term Spring 2013 The exam is 180 minutes long. The total score is 110pts. Please read the questions carefully. 1. Terminologies (24pts). a. Hardware Interrupt Ans: Services requests of I/O devices. b. Virtual Machine Ans: Virtual machine software provides an interface that is identical to the underlying bare hardware. c. Context Switch Ans: It saves the state of the currently running process and loads the state of the newly scheduled process. d. A Full Duplex Pipe Ans: A pipe that suppors two ways of message passing simultaneously. e. Multilevel Queue Scheduling Ans: Processes can be classified into different groups and permanently assigned to one queue, where there are Inter-queue and intra-queue scheduling policies. f. Memory Stall Ans: A phenomenon in which a processor waits for a significant amount of time waiting for the data to become available. g. Bounded Waiting (A Requirement of a Critical Section Solution) Ans: A waiting process only waits for a bounded number of processes to enter their critical sections. h. Adaptive Mutex Ans: A binary semaphore in which it is a spinlock if the lock-holding thread is running; otherwise, blocking is used. 2. Please answer the following questions regarding the designs of operating systems: (20pts) a. What is the difference between multiprogramming and time sharing? (6pts) b. Which one of the following memory unit is managed by the operating systems: Registers, Cache, Main Memory, Disks (8pts) c. Operating systems services include user interfaces. UNIX shells, including the Boume shell and C shell, provide command interpreters. Consider UNIX shells, please give me one command that is implemented as some code inside the command interpreter and two commands that are implemented by system programs? (6pts) Ans: (a) Time sharing (or multitasking) is a logical extension of multiprogramming, where CPU services each of ready tasks in a way that every task receives CPU time in an interactive fashion. (b) Main Memory and Disks. (c) Inside an interpreter: umask, chdir, limit (C shall), ulimit -H and -S (Bourne shell and KornShell) System programs: rm, ls. 3. Message passing is a way for interprocess communication. Consider the capacity of a link between two processes has zero capacity. Is the message passing (between the two processes) synchronous or asynchronous? You must provide explanation to receive any credits. (5pts) Ans: It is synchronous because we can only have blocking sends and blocking receives. 4. Please give me one occasion when a mid-term scheduler should run. Can a short-term scheduler schedule the executions of user-level threads? Can a short-term scheduler schedule the executions of a Java thread? (9pts) Ans: (a) The remaining main memory is low or the CPU utilization is too high. (b) No. (c) It depends on the thread library on the host system. 5. Consider signal handling for threads. Is a Division-By-Zero signal synchronous or asynchronous? Should a Division-By-Zero signal be delivered to every thread of its belonging process? (6pts) Ans: (a) synchronous. (b) No. It should be only sent to the thread that causes the signal. 6. Please answer the following questions for process scheduling. Explanation is needed to receive any credit. (24pts) a. For the Round-Robin Scheduling, what would be the preferred time slice in general? (4pts) b. For the Round-Robin Scheduling, shall we have a small time slice for a better average turn around time? (4pts) c. For the Priority Scheduling, how to avoid the starvation problem (in which a low priority process can never be scheduled)? (4pts) d. Please explain how a guest operating-system scheduling algorithm that assumes a certain amount of progress in a given amount of time might be negatively impacted by virtualization. (6pts) e. For the evaluation of a scheduling algorithm, please give me two difficulties in using the implementation method. (6pts) Ans: (a) The time slice ≧ 80% CPU burst. (b) No, a small time slice will increase the average turnaround time. (c) An aging solution by increasing the priority of a process that waits for a long time. (d) It is because the virtualization software needs to schedule the use of the physical CPUs among the virtual CPUs. A given amount of the time slice might take much more than the time of the virtual CPU time; (e) cost in modifying the OS, user reaction to OS changes, and the changing of the environment in which the algorithm is used. 7. Please explain the difference between the signal operation of a binary semaphore and that of a condition variable (of a monitor). (5pts) Ans: The signal operation of a condition variable resumes one suspended process. If there is none, no effect is imposed. 8. Consider a barber shop in which there are two barbers. Each barber can service exactly one customer at a time. Please use binary semaphores to implement the request for the hair-cut service. (l2pts) Ans: Use an integer C with initial value = 2 to indicate the number of available barbers. Modify the wait() and signal() algorithms for the implementations of counting semaphores for the solutions. 9. Consider the time-stamp protocol of Chapter 6, in which each process T_i is given a time stamp TS(T_i), and each read/write operation must check it up with the read and write timestamp of the accessed data object Q. Is it possible to have any deadlock? You must provide your explanation. (5pts) Ans: No deadlock because there is no hold-and-wait among processes. --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.160.224.155
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/NTU-Exam/M.1418537836.A.BB5.html
1F:→ rod24574575 : 已收资讯系! 12/14 16:28
※ 编辑: rod24574575 (140.112.16.189), 12/17/2014 19:46:31



※ 发信站: 批踢踢实业坊(ptt.cc)
※ 转录者: w4a2y4 (140.112.16.131), 05/01/2017 16:20:13







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

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

TOP