77范文网 - 专业文章范例文档资料分享平台

操作系统第九版部分课后作业习题答案(2)

来源:网络收集 时间:2019-01-05 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

Answer:

Number of frames LRU FIFO Optimal 1 20 20 20 2 18 18 15 3 15 16 11 4 10 14 8 5 8 10 7 6 7 10 7 7 77 7

9.9 Suppose that you want to use a paging algorithm that requires a reference

bit (such as second-chance replacement or working-set model), but the hardware does not provide one. Sketch how you could simulate a reference bit even if one were not provided by the hardware, or explain why it is not possible to do so. If it is possible, calculate what the cost would be. Answer:

You can use the valid/invalid bit supported in hardware to simulate the reference bit. Initially set the bit to invalid. On ?rst reference a trap to the operating system is generated. The operating system will set a software bit to 1 and reset the valid/invalid bit to valid.

9.10 You have devised a new page-replacement algorithm that you think

may

be optimal. In some contorted test cases, Belady’s anomaly occurs. Is the new algorithm optimal? Explain your answer. Answer:

No. An optimal algorithm will not suffer from Belady’s anomaly because —by de?nition—an optimal algorithm replaces the page that will not be used for the longest time. Belady’s anomaly occurs when a pagereplacement algorithm evicts a page that will be needed in the immediate

future. An optimal algorithm would not have selected such a page. 9.11

Segmentation

is

similar

to

paging

but

uses

variable-sized“pages.”De?ne

two segment-replacement algorithms based on FIFO and LRU pagereplacement schemes. Remember that since segments are not the same

size, the segment that is chosen to be replaced may not be big enough to leave enough consecutive locations for the needed segment. Consider strategies for systems where segments cannot be relocated, and those for systems where they can. Answer:

a. FIFO. Find the ?rst segment large enough to accommodate the incoming segment. If relocation is not possible and no one segment

is large enough, select a combination of segments whose memories are contiguous, which are “closest to the ?rst of the list” and which can accommodate the new segment. If relocation is possible, rearrange the memory so that the ?rstNsegments large enough for the incoming segment are contiguous in memory. Add any leftover space to the free-space list in both cases.Practice Exercises 33 b. LRU. Select the segment that has not been used for the longest period of time and that is large enough, adding any leftover space to the free space list. If no one segment is large enough, select a combination of the “oldest” segments that are contiguous in memory (if relocation is not available) and that are large enough. If relocation is available, rearrange the oldest N segments to be contiguous in memory and replace those with the new segment.

9.12 Consider a demand-paged computer system where the degree of multiprogramming is currently ?xed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening? Can the degree of multiprogramming be increased to increase the CPU utilization? Is the paging helping?

a. CPU utilization 13 percent; disk utilization 97 percent b. CPU utilization 87 percent; disk utilization 3 percent c. CPU utilization 13 percent; disk utilization 3 percent

Answer:

a. Thrashing is occurring.

b. CPU utilization is suf?ciently high to leave things alone, and increase degree of multiprogramming. c. Increase the degree of multiprogramming.

9.13 We have an operating system for a machine that uses base and limit registers, but we have modi?ed the machine to provide a page table. Can the page tables be set up to simulate base and limit registers? How can they be, or why can they not be? Answer:

The page table can be set up to simulate base and limit registers provided that the memory is allocated in ?xed-size segments. In this way, the base of a segment can be entered into the page table and the valid/invalid bit used to indicate that portion of the segment as resident in the memory. There will be some problem with internal fragmentation.

9.27.Consider a demand-paging system with the following time-measured utilizations: CPU utilization 20% Paging disk 97.7% Other I/O devices 5%

Which (if any) of the following will (probably) improve CPU utilization? Explain your answer.

a. Install a faster CPU. b. Install a bigger paging disk.

c. Increase the degree of multiprogramming. d. Decrease the degree of multiprogramming. e. Install more main memory.

f. Install a faster hard disk or multiple controllers with multiple hard disks.

g. Add prepaging to the page fetch algorithms. h. Increase the page size.

Answer: The system obviously is spending most of its time paging, indicating over-allocation

of memory. If the level of multiprogramming is reduced resident processes

would page fault less frequently and the CPU utilization would improve. Another way to

improve performance would be to get more physical memory or a faster paging drum.

a. Get a faster CPU—No. b. Get a bigger paging drum—No.

c. Increase the degree of multiprogramming—No. d. Decrease the degree of multiprogramming—Yes.

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库操作系统第九版部分课后作业习题答案(2)在线全文阅读。

操作系统第九版部分课后作业习题答案(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/405620.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: