首页 实验报告三 内存页面置换算法的设计

实验报告三 内存页面置换算法的设计

举报
开通vip

实验报告三 内存页面置换算法的设计实验报告三 内存页面置换算法的设计 实验报告三 ——内存页面置换算法的设计 姓名:丛菲 学号:20100830205 班级:信息安全二班 一、实习内容 • 实现最近最久未使用(LRU)置换算法 二、实习目的 • LINUX中,为了提高内存利用率,提供了内外存进程对换机制,内存空间的分配和 回收均以页为单位进行,一个进程只需将其一部分调入内存便可运行,还支持请求 调页的存储管理方式。 • 本实习要求学生通过请求页式存储管理中页面置换算法模拟设计,了解虚拟存储技 术的特点,掌握请求页式存储管理的页面置换算...

实验报告三 内存页面置换算法的设计
实验 报告 软件系统测试报告下载sgs报告如何下载关于路面塌陷情况报告535n,sgs报告怎么下载竣工报告下载 三 内存页面置换算法的设计 实验报告三 ——内存页面置换算法的设计 姓名:丛菲 学号:20100830205 班级:信息安全二班 一、实习内容 • 实现最近最久未使用(LRU)置换算法 二、实习目的 • LINUX中,为了提高内存利用率,提供了内外存进程对换机制,内存空间的分配和 回收均以页为单位进行,一个进程只需将其一部分调入内存便可运行,还支持请求 调页的存储管理方式。 • 本实习要求学生通过请求页式存储管理中页面置换算法模拟设计,了解虚拟存储技 术的特点,掌握请求页式存储管理的页面置换算法。 三、实习题目 1. 最近最久未使用(LRU)置换算法原理就是:当需要淘汰某页面时,选择当前一段时间内最久未使用过的页先淘汰,即淘汰距当前最远的上次使用的页。 • 例如: 分配给该进程的页块数为3,一个20位长的页面访问序列 为:12560,36536,56042,70435, 则缺页次数和缺页率按下图给出: 2. 假定分配给该进程的页块数为3,页面访问序列长度为20。本实验可以采用数组结构实现,首先随机产生页面序列,当发生请求调页时,若内存已满,则需要利用LRU算法,将当前一段时间内最久未使用过的页替换出去。 • 模拟程序的算法如下图: to prevent the accumulation of air, both ends of the tube are required the Center to bake. 6.2.5 sets should be at the bottom 200mm lashing cable head is fixed rung, with a similar cable color of plastic lashings. Cable head using "equal-width stacked" layout, or according to the size and space within the enclosure cable volume adjust, but you must ensure uniform, neat and elegant. 6.2.6 disc cabinet within cable shield layer requirements 四、实现代码为: #include #define M 3 #define N 20 #define Myprintf printf("|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|\n") /*表格控制*/ typedef struct page { int num; /*记录页面号*/ int time; /*记录调入内存时间*/ }Page; /* 页面逻辑结构,结构为方便算法实现设计*/ Page b[M]; /*内存单元数*/ int c[M][N]; /*暂保存内存当前的状态:缓冲区*/ int queue[100]; /*记录调入队列*/ int K; /*调入队列计数变量*/ /*初始化内存单元、缓冲区*/ to prevent the accumulation of air, both ends of the tube are required the Center to bake. 6.2.5 sets should be at the bottom 200mm lashing cable head is fixed rung, with a similar cable color of plastic lashings. Cable head using "equal-width stacked" layout, or according to the size and space within the enclosure cable volume adjust, but you must ensure uniform, neat and elegant. 6.2.6 disc cabinet within cable shield layer requirements void Init(Page *b,int c[M][N]) { int i,j; for(i=0;imax) { max=b[i].time; tag=i; } } return tag; } /*判断页面是否已在内存中*/ int Equation(int fold,Page *b) { int i; for(i=0;i=0) { b[val].time=0; for(i=0;i 分析 定性数据统计分析pdf销售业绩分析模板建筑结构震害分析销售进度分析表京东商城竞争战略分析 内 存页面数的变化对各种置换算法命中率的影响。 答: 内存页面数越多哦,命中率越高. LRU算法可以减少页错误率,较易理解. 最优算法页错误最低,且没有Belady异常,但是较难实现 FIFO算法容易理解和实现,但是页错误率较高 to prevent the accumulation of air, both ends of the tube are required the Center to bake. 6.2.5 sets should be at the bottom 200mm lashing cable head is fixed rung, with a similar cable color of plastic lashings. Cable head using "equal-width stacked" layout, or according to the size and space within the enclosure cable volume adjust, but you must ensure uniform, neat and elegant. 6.2.6 disc cabinet within cable shield layer requirements 七、实验总结 明白LRU算法的原理,当内存页面中不存在当前页面时,且没有空闲页面,将替换近期最少使 用的页面,这种算法可以有效减少替换掉常用页面的次数,从而减少页错误率. to prevent the accumulation of air, both ends of the tube are required the Center to bake. 6.2.5 sets should be at the bottom 200mm lashing cable head is fixed rung, with a similar cable color of plastic lashings. Cable head using "equal-width stacked" layout, or according to the size and space within the enclosure cable volume adjust, but you must ensure uniform, neat and elegant. 6.2.6 disc cabinet within cable shield layer requirements
本文档为【实验报告三 内存页面置换算法的设计】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_482581
暂无简介~
格式:doc
大小:82KB
软件:Word
页数:10
分类:生活休闲
上传时间:2018-12-18
浏览量:10