计算机科学与导论第七章答案_第1页
计算机科学与导论第七章答案_第2页
计算机科学与导论第七章答案_第3页
计算机科学与导论第七章答案_第4页
全文预览已结束

下载本文档

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

文档简介

1 CHAPTER 7 Operating Systems (Solutions to Review Questions and Problems) Review Questions Q7-1.An operating system is a program that facilitates the execution of application programs. Q7-2.Components of an operating systems are user interface, memory manager, process manager, device manager, and file manager. Q7-3.In monoprogramming, only a single program is in memory at any time. In multiprogramming, several programs are in memory at a time, but the resources of the computer are only assigned to the program that is running. Q7-4.In partitioning, memory is divided into variable-length sections, each of which holds one complete program. In paging, memory is divided into much smaller fixed-length sections as is the program itself; the program does not have to be contiguous in memory. Q7-5.In regular paging the entire program must be in memory at the same time in order for the program to execute. With demand paging, only some pages of a program can be in memory. This means that, in demand paging, more pro- grams can use the computers resources at any given time. Q7-6.A program is a non-active set of instructions stored on a disk and does not become a job until it is selected for execution. A job is a program that is scheduled for execution and does not become a process until it actually gets loaded into memory and starts executing. Q7-7.A process resides, at least in part, in main memory. Programs and jobs reside on a disk. Q7-8.The job scheduler moves a job from the hold state to the ready state or from the running state to the terminated state. The process scheduler moves a pro- cess from one state to another. Q7-9.An operating system needs to use queues because there can be many jobs and processes active at the same time. In order to share all of the resources, queues 2 are necessary to make sure that jobs and processes all get access to the resources that they need. Q7-10. Deadlock happens when processes are all waiting for resources held by other processes: they are all waiting for each other. This happens when the operat- ing system does not put resource restrictions on processes. Starvation happens when the operating system puts too many resource restrictions on a process. If a process must wait until it can get all of the resources that it needs before it starts to execute, it may never start. Problems P7-1.64 4 = 60 MB. P7-2.64 (10 + 4) = 50 MB. P7-3.70 / (70 + 10) 100 = 87.5%. P7-4.Figure P7-4 shows the partitions and memory used by each program. Total memory used = 17 + 8 + 10.5 + 20 = 55.5 MB. Total memory wasted = 2 + 1.5 +1 = 4.5 MB. Percent memory wasted = 4.5 / 60 100 = 7.5%. Figure P7-4Partitioning with different memory need 10 MB 2 MB wasted 1.5 MB wasted 1 MB wasted Second (8 MB) Third (10.5 MB) First (17 MB) Fourth (20 MB) 18 MB 20 MB 12 MB 3 P7-5.Figure P7-5 shows the partitions and memory used by each program. The total memory wasted = 2 + 8 + 10 = 20 MB. Memory wasted = 40 / 60 100 = 33.3 percent. The total memory used = 10 + 10 + 10 + 10 = 40 MB. P7-6. a.13 / 4 = 3.25 4 pages. b.12 / 4 = 3 pages. c.27 / 4 = 6.75 7 pages. d.15 (4 + 3 + 7) = 1 frame. e.Not considering memory lost inside each frame, one frame (4 MB) is unused. f. (4 / 60) 100 = 6.66%. P7-7. Total memory = 1000 + 100 = 1100 MB. Number of program = 1100 / 10 = 110. P7-8. a. running b. ready c. ready d. waiting e.waiting Figure P7-5Partitioning with same memory need 10 MB 10 MB wasted 2 MB wasted 8 MB wasted Second program (10 MB) Third program (10 MB) First program (10 MB) Fourth program (10 MB) 18 MB 20 MB 12 MB 4 P7-9.This is a deadlock situation (see Figure P7-9) because all four conditions of deadlock (mutual exclusion, resource holding, no preemption, and circular waiting) are all present. P7-10.This is not a deadlock situation (see Figure P7-10) because one of the neces- sary condition (circular waiting) is not present. Figure P7-9A deadlock situation Figure P7-10A non-deadlock situat

温馨提示

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

评论

0/150

提交评论