操作系统全英文期中考试题(带答案).doc_第1页
操作系统全英文期中考试题(带答案).doc_第2页
操作系统全英文期中考试题(带答案).doc_第3页
操作系统全英文期中考试题(带答案).doc_第4页
操作系统全英文期中考试题(带答案).doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

XX大学20112012学年第一学期操作系统期中考试试题(A)考试注意事项考试课程操作系统考试时间 120分钟 年 月 日题号一二三四总分满分20203030得分阅卷教师一、选择(每题1分,共20分)1. Which function does the operating system can not complete directly of the following four options? ( b ) A.Managing computers hard drive B.Compile the programC.Virtual memory D.Delete files2. Considering the function of the operating system, ( b ) must give timely response for the external request within the specified time. A. multiuser time sharing system B. real-time operating systemC. batch operating systemD. network operating system3. A process can transform from waiting state to ready state relying on ( d ) A. programmer commandB. system serviceC. waiting for the next time sliceD. wake-up of the cooperation process4. As we all know,the process can be thought of as a program in execution.We can deal with the the problem about ( b ) easier after importing the concept of process.A. exclusive resourcesB. shared resourcesC. executing in orderD. easy to execute5. CPU-scheduling decisions may take place under the following circumstances except which one?( D ) A. When a process switches from the running state to the waiting stateB. When a process switches from the running state to the ready stateC. When a process switches from the waiting state to the ready stateD. When a process switches from the ready state to the waiting state6. In the four common CPU scheduling algorithm, Which one is the best choice for the time-sharing system in general? ( C )A. FCFS scheduling algorithmB. Priority scheduling algorithmC. Round-robin scheduling algorithmD. Shortest-job-first scheduling algorithm7. If the initial value of semaphore S is 2 in a wait( ) and signal( ) operation,its current value is -1,that means there are ( B ) processes are waiting。A.0B.1C.2D.38. Generally speaking, we can deal with deadlock problem in three ways. Deadlock prevention is based on( c )A. allocate enough system resourcesB. make a reasonable processC. one of the destruction of the four necessary conditionsD.prevent the system go into a state of insecurity.9. In the operating system,wait( ) and signal( ) operation is a kind of( d )A. machine instructionB. system callsC. job controls commandD.low-level process communication primitives10. In the job scheduling algorithms,if all jobs come at the same time,which algorithm has the shortest average waiting time? ( d )A. FCFS scheduling algorithmB. Priority scheduling algorithmC. Round-robin scheduling algorithmD. Shortest-job-first scheduling algorithm11.Which of the following scheduling algorithms could result in starvation?( d )A. First-come,first-servedB. Multilevel queue schedulingC. Round robinD. Priority12.Data in the critical area can be used for only one process in the same time once,one principle of operating system call for the critical area is ( a )A.when no process is in critical areaB.when there is a process in critical areaC.when the process is in the ready state D.when the process is creating13.There are N processes in the system,then how many processes are there in the ready queue at most?( a ) AN BN-1 CN-2 DN-314. Two travel agencies A and B are going to booking airline tickets in a airline company,then exclusive resources is ( a )。A.airline tickets B.travel agencyC.airline company D.both travel agency and airline company15. If the system has five plotter,and there are two more processes are needed to use two plotter,every process can apply one plotter each time,then how many processes we can allow to participate in the competition at most and will not deadlock?( d )A. 5B. 2C. 3D.416. Primitive is a special system call, its feature is ( a )A. can not be interrupted when executingB. it calls itselfC. can be called by the outerD. strong function17. If the time slice is fixed in a time sharing system,then ( a ),the longer the response time is.A. the more the number of users B. the less the number of users C. the more memoryD. the less memory18. There are many reasons can cause the deadlock of a system, and the root cause of system deadlock is ( c )A. improper job schedulingB. too many processes in systemC. exclusive resourcesD. resource management and process promotion19. Usually we do not use the way of ( d ) to remove the deadlock.A.Ending a deadlock processB.Ending all the deadlock processesC.Grabbing resources from the deadlock processD.Grabbing resources from the non-deadlock process20. When processes are running in the processor, ( c ). A. Processes are independent,the system is closed. B. Processes are interactive,concurrent,and the are both interdependent and constrained C. processes may have contacts,and may not be.D. above are wrong 2、 填空(每空1分,共20分)1.A modern general-purpose computer system consists of one or more CPUs and a number of device controllers connected through a common bus that provides access to shared memory.(p6,1.2.1,L1)2.Main memory is the only large storage area that the processor can access directly. (p8,1.2.2,L2 and P34,1.13,L6) 3.One of the most important aspects of operating systems is the ability to multiprogram.A single user cannot,in general,keep either the CPU or the I/O devices busy all the time.(p15,1.4,L7) 4.In modern operating systems, resource allocation unit is process, processor scheduling unit is thread .(p127,4.1,L1)5.From a view of static state,the process of a operating system consists of program block,data and PCB(进程控制块).6.The two basic features of modern operating system are concurrent and shared .7.A socket is defined as an endpoint for communication.it is identified by an IP address concatenated with a port number.(p108,3.6.1,L1)8.The general idea behind a thread pool is to create a number of threads at process startup and place them into a pond, where they sit and wait for work.(p141,4.4.4,L12)9.There are many resources can only allow one process to use,if more than one process use these resources,it may cause confusion in the system,these resources are called Critical resource .(p193,6.2,L4)10.When the process execution time slice runs out,the process convert from running state to ready state.(p83)11.A major problem with priority scheduling algorithms is indefinite blocking(starvation).(p163,paragraph4,L1)12.Process synchronization is a kind of relationship between processes restricting each other logically.(p193,paragraph3,paragraph4)13.The interval from the time of submission of a process to the time of completion is the turnaround time . (p157,5.2,Turnaround time)14.CPU scheduling is the task of selecting a waiting process from the ready queue and allocating the CPU to it.The CPU is allocated to the selected process by the dispatcher.(p185,5.8,L1)15.A state is safe if the system can allocate resources to each process in some order and still avoid a deadlock.More formally,a system is in a safe state only if there exists a safe sequence .(p256,7.5.1,L1)16.Two or more processes are waiting indefinitely for an event that can be caused only by one of the waiting processes,these processes are said to be deadlocked .(p245,L3)17.Each time the wait() operation, the value of semaphore S reduce 1. If S0, then the process continue ,if S0,the process wait .18.There are two ways to avoid deadlock: static and dynamic, deadlock avoidance belongs to dynamic .19.In RR scheduling algorithm, if the time slice is too large, RR scheduling degenerates to FCFS scheduling;if the time slice is too small, scheduling overload in the form of context-switch time becomes excessive.(p186,L6)20.Deadlock avoidance requires that the operating system be given in advance additional information concerning which resources a process will request and use during its lifetime. (p252,paragraph4,L1)三、简答(每题5分,共30分)1. Define the term operating system. What basic functions does an OS perform? 开放题,解释操作系统概念,操作系统可以实现哪些基本功能?关键词:a.管理系统资源,控制程序运行,改善人机界面,为其他应用软件提供支持。b.基本功能:进程与处理机管理、作业管理、存储管理、设备管理、文件管理。2. Give a simple description of deadlock avoidance and deadlock prevention死锁预防:通过设置某些限制条件,去破坏产生死锁的四个必要条件中的一个或者几个条件,来防止死锁发生。死锁避免:不需事先采用各种限制措施去破坏产生死锁的必要条件,而是在资源的动态分配过程中,用某种方式去防止系统进入不安全状态,从而避免发生死锁。3. What do you think are the main powers to promote the development of operating system? List at least three reasons.开放题,有道理即可。如:(1)不断提高计算机资源利用率(2)方便用户(3)硬件不断更新换代(4)计算机体系结构的不断发展等。4. What is the difference between a program and a process? (1)程序是静态的指令序列,进程是动态的程序执行过程;(2)程序是永久性软件资源,进程是动态生存的暂存性资源;(3)进程具有并行特征,而程序没有;(4)进程是竞争计算机资源的基本单位;(5)不同的进程可以包含同一个程序,只要该程序对应的数据集不同。5. What are the reasons that cause the deadlock? What are the necessary conditions when the deadlock occur?1)a.系统资源不足,分配不当 b.进程推进顺序不合理2) 产生死锁的4个必要条件:(1)互斥条件:一个资源每次只能被一个进程使用。(2)请求与保持条件:一个进程因请求资源而阻塞时,对已获得的资源保持不放。(3)不剥夺条件:进程已获得的资源,在末使用完之前,不能强行剥夺。(4)循环等待条件:若干进程之间形成一种头尾相接的循环等待资源关系。6. Explain the following terms:1)Multiprocessor system2)System calls3)Thread1)多处理器系统是指包含两台或多台功能相近的处理器,处理器之间彼此可以交换数据,所有处理器共享内存,I/O设备,控制器,及外部设备,整个硬件系统由统一的操作系统控制。2)系统调用提供了应用程序和操作系统的接口。系统调用把应用程序的请求传给内核,调用相应的的内核函数完成所需的处理,将处理结果返回给应用程序。3)线程是处理机调度的基本单位,包括线程ID,当前指令指针,寄存器集合和对战组成。一个进程可以包含多个线程,并且他们可以并发执行。四、解答题(每题10分,共计30分)1. There is a warehouse can store two products A and B, but it requires:1) you can only store one kind of product(A or B )2) -Nthe number of product A-the number of product BMN and M is a positive integer.Please describe the process of A and Bs storage with wait() and signal() operation.信号量的定义如下:Var mutex,SA, SB :semphore=1,M-1,N-1;M,N为题目中给出的整数值。这里mutex用来作为互斥的信号量,保证每次只能存放一种产品(A或B);SA用来保证 A产品数量-B产品数量M,SB用来保证 -NA产品数量-B产品数量。对这两个信号量的具体操作是,每当放入一个A产品,SA的值减1,SB的值就加1;每当放入一个B产品,SA的值加1,SB减1;当然这些操作都是由PV完成的。具体程序如下:Begin PA:BeginRepeat P(SA) P(mutex) 放入一个A产品 V(mutex) V(SB)Until falseEnd PB:BeginRepeat P(SB) P(mutex) 放入一个B产品 V(mutex) V(SA)Until falseEnd2. Consider the following set of processes:Process server time slice priority A 8 3 B 1 1 C 3 3 D 2 4 E 5 2 The processes are assumed to have arrived in the order A、B、C、D、E.1) . Drew three Gantt charts that illustrate the execution of these processes using the following scheduling algorithms:FCFS, RR(time slice=1), SJF. (Does not consider the process switching time)2). Give the turnaround time and average turnaround time of every process with the three scheduling algorithms.(Does not consider the process switching time) Turnaround time Average turnaround timeprocessABCDE FCFS RR SJF3) . Assumed that in the RR scheduling algorithm(non-preemptive), each time the process switch to another one,it cost 10ns. And the time slice is 20ns, please calculate the throughput.1)FCFS A B CD ERR ABCDEACDEAC EAEA EAA A12345678910111213141516171819SJF BDC E A 2) 周转时间平均周转时间作业ABCDE FCFS8912141912.4 RR1921181611.2 SJF191631183)根据问题(1)中的甘特图,整个操作需要19个时间片,每次进程切换需要10ns,共切换18次,所以总共执行时间 =10*18+20*19= 560ns。5个进程在560ns之内完成,吞吐量=5/560 = 8.9 (个/ms)3. There are two groups of threads A and B with unspecified number of threads in each group. Two threads from group A and one thread from group B are required to establish a rendezvous in order to perform a specific

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论