NTU-Exam 板


LINE

課程名稱︰作業系統 課程性質︰必修 課程教師︰薛智文 開課學院:電資學院 開課系所︰資訊系 考試日期(年月日)︰2013/4/17 考試時限(分鐘):180min 是否需發放獎勵金:yes (如未明確表示,則不予發放) 試題 : This is an open-book and open-own-note exam. Please do answer with your own SUCCINCT words in the order of question number in EXACTLY one given answer sheet. You can answer in Chinese and keep these papers. Good luck. 1.[10%] Suppose that an engineer is designing an operating system, and decides to use a microkernel approach in order to keep the design flexible, secure, and reliable. After writing the operating system, the engineer decides that the implementation requires too much messeage passing between the kernel and one of the modules, lowering processor throughput due to frequent context switches. As a result, the programmer decides to allow the microkernel to share memory with this module. Describe at least one problem with this implementation that you might bring to the engineer's attention. 2.[10%] Peter's company has being commissioned with writing several emulators for different gaming platforms on the PC, including the PlayStation 3 and the PlayStation Portable. He needs to balance the usability of these emulators with the time he takes to write these emulators. What method of virtualization is better to implement the following system? The PlayStation 3 runs a 3.2 GHZ Cell Processor with 6 auxiliary processors, 256 MB of RAM and a 550 MHZ Graphics Card with 256 MB of dedicated memory. The PlayStation Portable runs a 333 MHZ Processors, 64 MB of ram, and no Graphics Card. 3.[5%] If there is a confliction between CPU and DMU accessing memory, which one will be given higher priority? Why? 4.[10%] What are the advantages of using thread pool instead of creating seperate threads for servicing respective request?[5%] What can we do when the number of requests varies a lot?[5%] 5.[10%] Netbook are a category of small, lightweight laptops (e.g. Eee PC and Aspire One.) As the network access becomes the main usage of person computers, the need of this kind of computer is emerging. In 2009, Google even released Google OS, an operating system based solely on Chrome browser which shipped in Chromebook (http://www.google.com/intl/en/chrome/devices/) 6.[10%] You were assigned to decide a CPU scheduler for a new type of smartphone. Please provide a reasonable solution considering ONLY that the CPU is less powerful.[5%] What if we consider other possible feathers of smartphone?[5%] 7.[15%] Consider a single philosopher in the Dining Philosophers problem. The philosopher can be in only one of the three states: EATING, THINKING, and HUNGRY. Suppose we want to schedule tasks for the philosopher to complete, and every task can be run during one state. If the scheduler tries to run a process that the philosopher cannot complete in her current state, then an exception occurs and the task is returned to the back of its ready queue. Assume that a philosopher cannot predict when she will enter a particular state, but that she will enter every state on a regular basis. c.[5%] Describe a scheduling algorithm that would ensure that every task is completed within finite time (no starvation). How does your algorithm achieve this goal? d.[10%] Now, suppose some tasks could be completed during more than one state. How could you improve throughput, with respect would introduce and how you would solve it. 8. [5%] Try to use the system call 'fork()' to implement a program that generate a child and print "Child!" and then back to the parent process and print "Parent!" 9.[10%] You are assigned to design a program that creates several threads of "visitors" and "cars". Visitors wander around for a random amount of time until they decide to go on a car ride. If they are first in line for a car ride and a car is available they take a ride, else they must wait till they are first in line or a car comes back. If there are no visitors in line the cars wait in order until a visitor wants to go on a ride. And in this program, you may use queue to memory both visitors and cars line. The pseudo code under describe the function of the visitor and car for the thread to run: 1.visitor{ 2. wandering around the park 3. join end of visitor queue 4. wait until at head of visitor queue 5. wait until there is a car free 6. remove car from car queue 7. remove self from visitor queue 8. occupy car 9. wait until not in car anymore 10.} 12.car{ 13. join end of car queue 14. wait until occupied 15. give ride to the visitor 16. eject visitor from car 17.} However, you would find something go wrong after you run the progeam. Obviously, the error caused by many race conditions hidden inside the psuedo code. Here are several functions to help you make all threads function properly: lock_c();/*lock for the car queue*/ unlock_c();/*unlock for the car queue*/ lock_v();/*lock for the visitor queue*/ unlock_v();/*unlock for the visitor queue*/ Please explain where to put there functions and why? ※Note the these function only control queues not all threads 10.[10%] None of the servers are able to address the C10k problem by using threads. What disadvantage make threads useless for this situation? Write down two disadvantages with brief explanation.[5%] How do you solve it?[5%] "The C10k problem refers to the problem of optimising server software to handle a large number of clients at the same time (hence the name C10k - concurrent ten thousand connections). The problem of socket server optimisation has been studied because a number of factors must be considered to allow a web server to support many clients. This can involve a combination of operating system constraints and server software limitations." --From Wikipedia 11.[5%] When multiple threads run in parallel on a multicore system, would the more threads for the same tasks always finish earlier when the number of threads is less than the number of cores? Why? 12.Describe the problem for the following implementation of a critical section.[10%] do{ turn = j; flag[i] = TRUE; while(flag[i] && turn ==j); critical section flag[i]=false; remainder section }while(1); --



※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.30.130 ※ 編輯: yet5438 來自: 140.112.30.130 (04/17 23:02)







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