ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:64.71KB ,
资源ID:9633279      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9633279.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(操作系统精髓与设计原理第五版 课后题答案.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

操作系统精髓与设计原理第五版 课后题答案.docx

1、操作系统精髓与设计原理第五版 课后题答案Chapter 2Operating System OverviewReview Questions2.1 Convenience: An operating system makes a computer more convenient to use. Efficiency: An operating system allows the computer system resources to be used in an efficient manner. Ability to evolve: An operating system should be

2、 constructed in such a way as to permit the effective development, testing, and introduction of new system functions without interfering with service.2.5 The execution context, or process state, is the internal data by which the operating system is able to supervise and control the process. This int

3、ernal information is separated from the process, because the operating system has information not permitted to the process. The context includes all of the information that the operating system needs to manage the process and that the processor needs to execute the process properly. The context incl

4、udes the contents of the various processor registers, such as the program counter and data registers. It also includes information of use to the operating system, such as the priority of the process and whether the process is waiting for the completion of a particular I/O event.Problems2.1 The answe

5、rs are the same for (a) and (b). Assume that although processor operations cannot overlap, I/O operations can. 1 Job: TAT = NT Processor utilization = 50% 2 Jobs: TAT = NT Processor utilization = 100% 4 Jobs: TAT = (2N 1)NT Processor utilization = 100%2.4 A system call is used by an application prog

6、ram to invoke a function provided by the operating system. Typically, the system call results in transfer to a system program that runs in kernel mode.Chapter 3Process Description and ControlReview Questions3.5 Swapping involves moving part or all of a process from main memory to disk. When none of

7、the processes in main memory is in the Ready state, the operating system swaps one of the blocked processes out onto disk into a suspend queue, so that another process may be brought into main memory to execute.3.10 The user mode has restrictions on the instructions that can be executed and the memo

8、ry areas that can be accessed. This is to protect the operating system from damage or alteration. In kernel mode, the operating system does not have these restrictions, so that it can perform its tasks.Problems3.1 Creation and deletion of both user and system processes. The processes in the system c

9、an execute concurrently for information sharing, computation speedup, modularity, and convenience. Concurrent execution requires a mechanism for process creation and deletion. The required resources are given to the process when it is created, or allocated to it while it is running. When the process

10、 terminates, the OS needs to reclaim any reusable resources. Suspension and resumption of processes. In process scheduling, the OS needs to change the processs state to waiting or ready state when it is waiting for some resources. When the required resources are available, OS needs to change its sta

11、te to running state to resume its execution. Provision of mechanism for process synchronization. Cooperating processes may share data. Concurrent access to shared data may result in data inconsistency. OS has to provide mechanisms for processes synchronization to ensure the orderly execution of coop

12、erating processes, so that data consistency is maintained. Provision of mechanism for process communication. The processes executing under the OS may be either independent processes or cooperating processes. Cooperating processes must have the means to communicate with each other. Provision of mecha

13、nisms for deadlock handling. In a multiprogramming environment, several processes may compete for a finite number of resources. If a deadlock occurs, all waiting processes will never change their waiting state to running state again, resources are wasted and jobs will never be completed.3.3Figure 9.

14、3 shows the result for a single blocked queue. The figure readily generalizes to multiple blocked queues.Chapter 4Process Description and ControlReview Questions4.2 Less state information is involved.4.5 Address space, file resources, execution privileges are examples.4.6 1. Thread switching does no

15、t require kernel mode privileges because all of the thread management data structures are within the user address space of a single process. Therefore, the process does not switch to the kernel mode to do thread management. This saves the overhead of two mode switches (user to kernel; kernel back to

16、 user). 2. Scheduling can be application specific. One application may benefit most from a simple round-robin scheduling algorithm, while another might benefit from a priority-based scheduling algorithm. The scheduling algorithm can be tailored to the application without disturbing the underlying OS

17、 scheduler. 3. ULTs can run on any operating system. No changes are required to the underlying kernel to support ULTs. The threads library is a set of application-level utilities shared by all applications.4.7 1. In a typical operating system, many system calls are blocking. Thus, when a ULT execute

18、s a system call, not only is that thread blocked, but also all of the threads within the process are blocked. 2. In a pure ULT strategy, a multithreaded application cannot take advantage of multiprocessing. A kernel assigns one process to only one processor at a time. Therefore, only a single thread

19、 within a process can execute at a time. Problems4.2Because, with ULTs, the thread structure of a process is not visible to the operating system, which only schedules on the basis of processes.Chapter 5Concurrency: Mutual Exclusion and SynchronizationReview Questions5.1 Communication among processes

20、, sharing of and competing for resources, synchronization of the activities of multiple processes, and allocation of processor time to processes.5.9 A binary semaphore may only take on the values 0 and 1. A general semaphore may take on any integer value.Problems5.2 ABCDE; ABDCE; ABDEC; ADBCE; ADBEC

21、; ADEBC; DEABC; DAEBC; DABEC; DABCE5.5Consider the case in which turn equals 0 and P(1) sets blocked1 to true and then finds blocked0 set to false. P(0) will then set blocked0 to true, find turn = 0, and enter its critical section. P(1) will then assign 1 to turn and will also enter its critical sec

22、tion.Chapter 6Concurrency: Deadlock and StarvationReview Questions6.2 Mutual exclusion. Only one process may use a resource at a time. Hold and wait. A process may hold allocated resources while awaiting assignment of others. No preemption. No resource can be forcibly removed from a process holding

23、it.6.3 The above three conditions, plus: Circular wait. A closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain.Problems6.4 a. 0 0 0 0 0 7 5 0 6 6 2 2 2 0 0 2 0 3 2 0 b. to d. Running the bankers algorithm, we see processes can f

24、inish in the order p1, p4, p5, p2, p3. e. Change available to (2,0,0,0) and p3s row of still needs to (6,5,2,2). Now p1, p4, p5 can finish, but with available now (4,6,9,8) neither p2 nor p3s still needs can be satisfied. So it is not safe to grant p3s request.6.5 1. W = (2 1 0 0) 2. Mark P3; W = (2

25、 1 0 0) + (0 1 2 0) = (2 2 2 0) 3. Mark P2; W = (2 2 2 0) + (2 0 0 1) = (4 2 2 1) 4. Mark P1; no deadlock detectedChapter 7Memory ManagementReview Questions7.1 Relocation, protection, sharing, logical organization, physical organization.7.7 A logical address is a reference to a memory location indep

26、endent of the current assignment of data to memory; a translation must be made to a physical address before the memory access can be achieved. A relative address is a particular example of logical address, in which the address is expressed as a location relative to some known point, usually the begi

27、nning of the program. A physical address, or absolute address, is an actual location in main memory.Problems7.6 a. The 40 M block fits into the second hole, with a starting address of 80M. The 20M block fits into the first hole, with a starting address of 20M. The 10M block is placed at location 120

28、M. b. The three starting addresses are 230M, 20M, and 160M, for the 40M, 20M, and 10M blocks, respectively. c. The three starting addresses are 80M, 120M, and 160M, for the 40M, 20M, and 10M blocks, respectively.7.12 a. The number of bytes in the logical address space is (216 pages) (210 bytes/page)

29、 = 226 bytes. Therefore, 26 bits are required for the logical address. b. A frame is the same size as a page, 210 bytes. c. The number of frames in main memory is (232 bytes of main memory)/(210 bytes/frame) = 222 frames. So 22 bits is needed to specify the frame. d. There is one entry for each page

30、 in the logical address space. Therefore there are 216 entries. e. In addition to the valid/invalid bit, 22 bits are needed to specify the frame location in main memory, for a total of 23 bits. d. The three starting addresses are 80M, 230M, and 360M, for the 40M, 20M, and 10M blocks, respectively.Ch

31、apter 8Virtual MemoryReview Questions8.1 Simple paging: all the pages of a process must be in main memory for process to run, unless overlays are used. Virtual memory paging: not all pages of a process need be in main memory frames for the process to run.; pages may be read in as needed8.2 A phenome

32、non in virtual memory schemes, in which the processor spends most of its time swapping pieces rather than executing instructions.Problems8.1 a. Split binary address into virtual page number and offset; use VPN as index into page table; extract page frame number; concatenate offset to get physical memory address b. (i) 1052 = 1024 + 28 maps to VPN 1 in PFN 7, (7 1024+28 = 7196) (ii) 2221 = 2 1024 + 173 maps to VPN 2, page fault (iii) 5499 = 5 1024 + 379 maps to VPN 5 in PFN 0

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1