b04902xxx 板


LINE

※ [本文转录自 NTU-Exam 看板 #1NQf-lUj ] 作者: jim841019g (逆转魂) 看板: NTU-Exam 标题: [试题] 104下 郭大维 作业系统 期中考+解答 时间: Wed Jun 22 22:24:44 2016 课程名称︰作业系统 课程性质︰必修 课程教师︰郭大维 开课学院:电资学院 开课系所︰资工系 考试日期(年月日)︰2016.05.11 考试时限(分钟): 试题 : Operating Systems Midterm Spring 2016s The Exam is 180 minutes long. The total score is 105pts. Please read the questions carefully. 1.Terminologies(24pts) a. Software Interrupts It is, in general, caused by software execution, e.g. signals,invalid memory access, division by zero, system calls. b. Performance Tuning A procedure that seeks to improve performance by removing bottlenecks. c. Mid-Term Scheduler Swap processes in and out to control the degree of multiprogramming. d. FIFOS of UNIX Named pipes. e. Asynchronous Signal An asynchronous signal usually reports some asynchronous event outside the program, e.g., ^C or time expiration. f. Push Migration (Hint:Load Balancing) A specific task periodically checks for imbalance and migrates tasks. g. Coarse-Grained Multithreading of Hardware Threads Coarse-grained multithreading only switches to issue instructions from another thread when the current executing thread cause some long latency events. h. Analytic Evaluation Take a particular predetermined workload and defines the performance of each algorithm for that workload 2. Please answer the following questions regarding operating systems:(20pts) a. Please compare the difference between interrupt handling by a generic handler and interrupt vector in terms of the mechanism and the response performance. (6pts) b. Please compare the difference between the terms "time sharing" and "multiprogramming". (4pts) c. One of the most challenging parts in the implementations of a virtual machine is to satisfy the assumption of a certain amount of progress in a given amount of time. Please explain the challenge.(6pts) d. Parameter passing is an important issue in the implementation of command interpreters. Please explain how a command interpreter of Unix passes parameters to the running process of a command issued on the command interpreter. (4pts) Ans: (a) mechanism: a generic handler finds out the interupt type and invokes the corresponding procedure but the interrupt vector lets the corresponding procedure directly invoked though checking up of the interrupt vector; performance: interrupt vector is faster. (b) Time sharing is a logical extension of multiprogramming in which CPU time is quickly switching among tasks to share time. (c) You can use the example in the class when two virtual cores share a physical core, in which a task must run for 2ms for every 5ms, but its virtual machine might not receive any service within a 5ms time window (d) It can be done by using one of the exec() system calls. 3. Consider process states: New, Ready, Running, Waiting, and Terminated. Please explain how a state makes a transition to another state, where there is only one processor.12(pts) Ans:same in the CH3 p.6 4. Message passing is one major way for interprocess communication. What is the main difficulty in using symmetric addressing for direct communication? For indirect communication, small messages are sent from a sender to a receiver usually by message copying. How to reduce system overheads in-sending large messages to a receiver?(8pts) Ans: (a) process naming (or modularity) (b) remapping of addressing space. 5. For multicore programming, there could be data parallelism or task parallelism. Please explain how to use data parallelism to find the largest integer of a given set of integers.(5pts) Ans: First split data over N cores, and let each core find the largest integer of its given integers. Then let one core find the largest integers among the latgest integers found on each core. 6. Please answer the following questions for process scheduling. Explanation is needed to receive any credit. (15pts) a. Is the First-Come, First-Served Scheduling (FIFO) a non-preemptive or preemptive scheduling algorithm? Why? (4pts) b. Given 4 processes P1,P2,P3, and P4 with CPU burst time 5,2,4, and6, respectively. Suppose that the P1,P2,P3,and P4 all arrive at time 0. What is the average waiting time in running the 4 processes under the Round-Robin Scheduling with the time slice equal to 3? (5pts) c. Longest-Job-First Scheduling always schedules the process of the longest CPU burst first. When all processes arrive at time 0, does Longest-Job-First Scheduling have the largest average turnaround time? (6pts) Ans: (a) It is non-preemptive because the running process will not volunteer to give up its CPU until it stops. (b) (No answer) (C) Yes.... Proof by swapping of process with larger and smaller CPU bursts... 7. Consider the intersection of the following two roads, where cars can go from each of the four directions. There is a stop sign for each direction so that every car must stop at the intersection and wait for any car that arrives earlier at the intersection to leave first. a. Please use semaphores to implement your solution with some pseudo code. (10pts) b. Please prove that your above solution satisfy the three requirements of the Critical Section Problem. (6pts) c. Could you revise your solution so that an ambulance can always go first? (5pts) ┌───┐ ┌───┐ │ │↓ │ │ └───┘ └───┘ ← → ┌───┐ ┌───┐ │ │ ↑│ │ └───┘ └───┘ Ans: (a) and (b) Assumtion: Semaphores with a FIFO queue (c) Let the ambulance has the priority in the waiting queue. --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.112.16.147
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/NTU-Exam/M.1466605487.A.7AD.html ※ 编辑: jim841019g (140.112.16.147), 06/22/2016 22:26:31 ※ 编辑: jim841019g (140.112.16.147), 06/22/2016 22:27:11
1F:推 rod24574575 : 已收资讯系! 06/23 01:50



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







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

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

TOP