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

请输入看板名称,例如:e-shopping站内搜寻

TOP