NTU-Exam 板


LINE

课程名称︰作业系统 课程性质︰大二必修 课程教师︰郭大维 开课学院:电机资讯学院 开课系所︰资讯工程学系 考试日期(年月日)︰2018/05/23 考试时限(分钟):180分钟 试题 : Operating Systems Mid-Term Spring 2018s The exam is 180 minutes long. The total score is 112pts. Please read the questions carefully. 1. Terminologies (24pts). a. init (Hint: Booting; a UNIX process) A user process that initializes system processes, e.g., various daemons, login processes, after the kernel has been bootstrapped. b. Dual-Mode Operations (Hint: Mode Bit) Privileged and user-mode instructions, where privileged instructions are machine instructions that may cause harm. c. Memory Protection (Hint: Hardware Protection) Prevent a user program from modifying the code or data structures of either the OS or other users! d. A Modular Kernel A set of core components with characteristics: layer-like - modules; microkernel-like - the primary module. e. Asymmetric Addressing for Direct Communication In Direct Communication, sender must specify the receiver ID, but the receiver does not need to specify the sender ID. For example, Send(P, msg), Receive(id, msg). f. Remote Procedure Call (RPC) A way to abstract the procedure-call mechanism for use between systems with network connection. g. FIFOS of UNIX Named pipes of UNIX. It is a file in the file system and created by mkfifo(). It offers Half Dulex and Byte-Oriented Transmissions. h. Implicit Threading Transfer the creation and management of the threading from the application developers to compilers and run-time libraries. 2. For the implementation of the UNIX process control block PCB[], we have proc[] and .u, which contain different attributes for different purposes (e.g., those must be known regardless of whether the process is running). Which one is in the kernel or user address space? Are they both in the kernel or user address space? Which one of proc[] and .u signal disposition resides? Where thread-specific data/thread local storage will reside (in the kernel or user address space)? (8pts) (a) kernel address space: proc[]; user-address space: .u (b) .u: signal disposition (c) user address space 3. Please answer the following questions regarding operating systems: (21pts) a. When timing sharing appears as a feature for operating systems, please tell us two emerging features/subsystems, beside job synchronization. (6pts) b. Virtual machine software provides an interface that is identical to the underlying bare hardware. I/O over a virtual machine could be slow or fast, depenging on the implementations. Please give me a case in which I/O is fast, compared to I/O directly over physical devices. (5pts) c. There are operating sysrtem services, such as program executions, I/O operations, accounting, resource allocation, error detection. Which one is belonging to those for user convenience? Which one is belonging to those for system efficiency? (10pts) (a) one-line file systems, virtual memory, sophisticated CPU scheduling. (b) I/O can be fast over a hard disk when the correpsonding disk is implemented over DRAM by emulation. (c) user convenience: program executions, I/O operations, error detection; system efficiency: accounting, resource allocation 4. Multithreading is important for multi-core architectures. Please answer the following questions: (12pts) a. Task parallelism is one typical parallelism type. Please give one example for task parallelism. (5pts) b. Please provide two challenges in multicore programming. (4pts) c. Why the context switching costs of kernel-level threads is higher than that of user-level threads? (3pts) (a) Run merge sorting over cores by partitioning data. (b) Identifying Tasks - Dividing Activities, Balance, Data Splitting, Data Dependency, Testing and Debugging. (c) Context switching cost is little bit higher because the kernel must do the switching. 5. Compare preemptive scheduling and non-preemptive scheduling. Please answer the following questions: (21pts) a. In what circumstance, non-preemptive scheduling will be better than preemptive scheduling? (4pts) b. The selection of CPU scheduling algorithms should consider the scheduling criteria. If the high throughput is the criterion, which one is the best: Shortest job first, FIFO, and round-robin scheduling. You must provide answer to get credits. (6pts) c. Priority scheduling is a framework for scheduling. Please design a priority assignment formula that gives a lower priority to a job when it runs more time. (5pts) d. For Round-Robin Scheduling, if the lower average time turnaround time is the criterion, shall we prefer a lower time slice? Suppose that all jobs are ready at time 0. You must provide answer to get credits. (6pts) (a) Non-preemptive scheduling could be better than preemptive scheduling when all jobs are ready together at time 0. (b) Shortest job first. (c) priority = 1 / consumed-CPU-time (d) A lower time slice is bad to the low average turnaround time. 6. Processor Affinity is somehow against push migration. Please explain why. (6pts) It is because of the cost in cache repopulation. 7. Please explain the progress assumption concerns for virtualization. (6pts) It is assumed that a certain ammount of progress should be observed for a system in a given amount of time under virtualization. 8. Consider solutions to the Critical Section Problem. Please answer the following qusetions. (14pts) a. Consider a computing server to service jobs from three FIFO queues in a round robin way whenever there are jobs in any non-empty queues. Please use semaphores to implement your solution with some pseudo code. (6pts) b. What is the difference between a binary semaphore and a condition variable? (3pts) c. The Monitor-based implementation of the Dining Philosipher problem in the textbook implements the idea of two-chop-stick-per-time solution. Will it have the starvation problem? You must provide explanation to receive credits. (5pts) (a) We let, the dispatcher of each job queue to wait a shared semaphore whenever it has a pending job. Let the semaphore have a FIFO queue. (b) A condition variable has nothing happening to a signal request if no job is waiting for the variable. (c) Yes, the starvation problem happens to a philosipher whenever his two neighboring philosiphers take turn in eating while he is waiting. --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 61.230.118.22
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/NTU-Exam/M.1530812862.A.148.html
1F:推 rod24574575 : 已收资讯系! 07/07 12:49







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