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/m.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燈, 水草

請輸入看板名稱,例如:WOW站內搜尋

TOP