《(精品)操作系统试卷os08(B)-东南大学-计算机学院-操作系统试卷.doc》由会员分享,可在线阅读,更多相关《(精品)操作系统试卷os08(B)-东南大学-计算机学院-操作系统试卷.doc(6页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、东 南 大 学 考 试 卷(B 卷)自 觉 遵 守 考 场 纪 律 如 考 试 作 弊 此 答 卷 无 效学号 姓名 密封线课程名称操作系统考试学期07-08-2得分适用专业计算机应用考试形式闭卷考试时间长度120分钟一、Definitions 5X6=30 ptsGive the technical term that best fits these definitions1. Portion of a program that accesses shared variables and that no two processes can be executing this code tha
2、t manipulates shared variables at the same time.2. It is a method of overlapping the I/O of a job with that jobs own computation. The idea is simple. After a read operation completes and the job is about to start operating on the data, the input device is instructed to begin the next read immediatel
3、y. The CPU and input device are then both busy. 3. Some devices, such as tape drives and printers, cannot usefully multiplex the I/0 requests of multiple concurrent applications. The subsystems can coordinate concurrent output to a separate disk file. For instance, When an application finishes print
4、ing, the subsystem copies the queued files to the printer one, at a time.4. Unused routine is never loaded.5. A process is busy swapping pages in and out.6. A small operating system core that provides basic scheduling, memorymanagement and communication services while relying on processes to perform
5、the other required functionality traditionally associated with the operating system.二、Comparisons6+9=15ptsComplete the following comparisons using True, False or Possible1.6ptsBlocking I/o versus Noblocking I/OPoint of Comparison Blocking I/O Noblocking I/OI/O call returns as much as availableImplem
6、ented via multi-threading2. 9 pts Threads versus processesPoint of Comparison Threads ProcessesShare all global variables Execute in separate address spaces Require less time to create, terminate and switch from one to another 三、Computing10+12=22 pts1.Suppose that a disk drive has 5000 cylinders, nu
7、mbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130 Starting from the current head position, what is the total distance (in cylinders
8、) that the disk arm moves to satisfy all the pending requests, for each of the following disk-scheduling algorithms? 10 pts a. SSTFb. LOOK2. Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:Process Burst Time PriorityP1 10 3P2 1 1P3 2 3P4 1 4P5 5 2
9、The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. 12 ptsa. Draw the Gantt chart illustrating the execution of these processes using SJF, a nonpreemptive priority (a smaller priority number implies a higher priority) scheduling.b. What is the turnaround time of
10、 each process for the scheduling algorithm in part a?c. What is the waiting time of each process for the scheduling algorithm in part a?四、Answer the following questions 8+10=18 pts1.What is a race condition? When does it happen? 8pts2. Under what circumstances do page faults occur ? Describe the act
11、ions taken by the operating system when a page fault occurs. 10pts五、Programming15 ptsThe Sleeping-Barber Problem. A barbershop consists of a waiting room with n chairs, and a barber room with one barber chair. If there are no customers to be served, the barber goes to sleep. If a customer enters the
12、 barbershop and all chairs are occupied, then the customer leaves the shop. If the barber is busy, but chairs are available, then the customer sits in one of the free chairs. If the barber is asleep, the customer wakes up the barber. Write a program to coordinate the barber and the customers using J
13、ava synchronization(or vc+ with P and V operations).B卷答案一、Definitions 5X6=30 pointsGive the technical term that best fits these definitions1. Critical Section2. Prefetching3.sppoling4. Dynamic loading5. Thrashing6. Microkernel二、Comparisons15ptsComplete the following comparisons using True, False or
14、Possible1)6ptsBlocking I/o versus Noblocking I/OFalse TruePossible True 2) 9 pts Threads versus processesTrue False False True True False三、Computing22 points1.a.The SSTF schedule is 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750, 1774. The total seek distance is 1745.b. The LOOK schedule is 143, 913
15、, 948, 1022, 1470, 1509, 1750, 1774, 130, 86. The total seek distance is 3319.2. Answer:a. The two Gantt charts are2 3 4 5 1 5 1 5 1 5 1 1 3 1 51 3 4 5 2b. Turnaround time(SJF and priority)P1 19 ,16 P2 1 ,1 P3 4 ,18 P4 2 ,19 P5 9 ,6c. Waiting time (turnaround time minus burst time)P1 9 ,6 P2 0 , 0 P
16、3 2 ,16 P4 1 ,18 P5 4 ,1四、Answer the following questions 1The situation where several processes access and manipulate shared data concurrently. The final value of the shared data depends upon which process finishes last.2During address translation, if validinvalid bit in page table entry is 0 page f
17、ault. If there is ever a reference to a page, first reference will trap to OS page fault OS looks at another table(in PCB) to decide: Invalid reference abort. Just not in memory page it in. Get empty frame. Swap page into frame. Reset tables, validation bit = 1. Restart instruction: Least Recently Used .共 页 第 页