资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
操作系统期中作业姓名: _学号: 专业: 一、For each of the following statements, Choosing True or False 1. Binary semaphores are those that are used by no more than two threads. F2. The Bankers algorithm is a way of preventing deadlock . F3. A multi-level indexed file permits faster random access than a contiguously allocated file. F 4. An atomic operation is a machine instruction or a sequence of instructions that must be executed to completion without interruption. T5. Deadlock is a situation in which two or more processes (or threads) are waiting for an event that will occur in the future. F6. Starvation is a situation in which a process is denied access to a resource because of the competitive activity of other, possibly unrelated, processes. T7. While a process is blocked on a semaphores queue, it is engaged in busy waiting. F8. Mutual exclusion can be enforced with a general semaphore whose initial value is greater than 1. F9. A printer is an example of a logical resource. F10. Versions of OS/360 are still widely used today. F11. When an executing process is stopped by the scheduler, it is said to be blocked. F12. Interrupts are used to achieve a typical timesharing OS. T二、Multiple Choice Questions For each of the following questions, There is only one correct answer. 1. What is the purpose of system calls?a) System calls allow user-level processes to gain resources from the operating system.b) System calls are the standard interface between a user process and a kernel process.c) System calls allow user-level processes to request services of the operating system.d) There is no real purpose to system calls.2. Threads belonging to the same process share thea) stackb) data sectionc) register setd) thread ID3. In Many-to-One thread model, What would happen if a thread in a multithreaded process makes a blocking system call ?a) the other threads of the process would continue to runb) the entire process would get blockedc) the blocking thread will get killedd) the blocking thread will never get to run again4. Which of the following Operating systems uses preemptive scheduling?a) Mac OS 8b) Windows 3.xc) Windows 2000d) DOS 6.05. A measure of the number of processes completed per time unit is calleda) throughputb) waiting timec) response timed) CPU utilization6. One of the problems with priority scheduling isa) agingb) starvationc) process deathd) average waiting time7. In a time-sharing system, which of the following is the best criterion for CPU scheduling.a) Minimize CPU utilization b) Maximize CPU utilizationc) Maximize system throughput d) Minimize response time.8. The initial value of semaphore S is 2. if the value is -1 at present, how many processes are blocked on this semaphore .a) 1 b) 2 c) 3 d) 49. A system is in a deadlock, if its resource allocation grapha) contains a cycleb) doesnt contain a cyclec) contains a cycle and there is just one instance of every resourced) has at least one outgoing edge from any one of the process nodes10. Preemption of resources can be enforced to prevent occurrence of deadlocks, but this cant be applied to all the resource types, as preemption might leave the resource in an undetermined state. Which of the following resources cant hence be preempted?a) CPU registersb) memory spacec) tape drived) all of the above11. A system is said to be _ if it can continue to function even when a node or nodes in the system fail.a) networkedb) distributedc) real timed) fault-tolerant12. Which of the following activity needs no special hardware support? a) Process schedulingb) timer managementc) memory mappingd) interrupt system13. Which of the following statement about processes is incorrect? a) A process is dynamic. b) A process has a lifetime. c) A process is a set of instructions.d) Multiple processes may execute concurrently. 三、Consider the following set of processes:Process Burst-Time PriorityP1 154P2 38P3 75P4 52P5 16P6 26The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, P6, all at time 0.Use FCFS, SJF, Round Robin (quantum is 2), Priority(low numbers have high priority). For each of the algorithms:1 Draw a Gantt chart2. What is the average waiting time for each of the scheduling algorithms?3. What is the average turnaround time for each of the scheduling algorithms?Answer:FCFS:P1P2P3P4P5P6 15 18 25 30 31 33AWT=(0+15+18+25+30+31)/6=19.83ATT=(15+18+25+30+31+33)/6=25.33SJF:P5P6P2P4P3P1AWT=(18+3+11+6+0+1)/6=6.5ATT=(33+6+18+11+1+3)/6=12Round-Robin(quantum=2):P1P2P3P4P5P6P1P2P3P4P1P3P4P1P3P1AWT=(18+11+19+8+9)/
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号