文件名称:subject_3
介绍说明--下载内容均来自于网络,请自行研究使用
编写一个请求页式存储管理模拟程序,通过对页面置换过程的模拟,加深对请求页式存储管理方式基本原理及实现过程的理解。
要求:
1. 从键盘输入页面访问序列及分配给进程的内存块数;
2. 分别采用OPT、FIFO和LRU算法进行页面置换(说明:对于OPT算法,在有多个页面可选的情况下,先淘汰较早进入的页面)。
3. 计算缺页次数及缺页率。
测试用例格式如下:
输入:
算法(1 OPT,2 FIFO,3 LRU)
内存块数
页面序列(页面1,页面2,页面3,...)
输出:
页面变化时内存块装入页面列表1-是否命中/页面变化时内存块装入页面列表2-是否命中/...
缺页次数
其中:
页面变化时内存块装入页面列表:内存块1装入页面,内存块2装入页面,内存块3装入页面...,未装入任何页面时由 -”表示
是否命中:1-命中,0-缺页-Write a request page storage management simulation program, through the page replacement process simulation, to deepen understanding of the requested page storage management basic principles and processes. Requirements: 1. Memory blocks the keyboard to access the page sequence and allocated to the process 2. respectively OPT, FIFO and LRU page replacement algorithm (Note: For OPT algorithm, in case there are multiple pages optional, elimination of early entry into the first page). 3. Calculate the number of page faults and page fault rate. Test format is as follows: Input: Algorithms (1- OPT, 2- FIFO, 3- LRU) memory block sequence number of pages (page 1, page 2, page 3, ...) Output: change the page memory block load page loaded memory block list list of pages that have been hit 1-/2- page changes if hit/... number of page faults wherein: when the page is loaded into memory block change list page: 1 load the page memory block, memory block 2 load the page, the page is loaded ... memo
要求:
1. 从键盘输入页面访问序列及分配给进程的内存块数;
2. 分别采用OPT、FIFO和LRU算法进行页面置换(说明:对于OPT算法,在有多个页面可选的情况下,先淘汰较早进入的页面)。
3. 计算缺页次数及缺页率。
测试用例格式如下:
输入:
算法(1 OPT,2 FIFO,3 LRU)
内存块数
页面序列(页面1,页面2,页面3,...)
输出:
页面变化时内存块装入页面列表1-是否命中/页面变化时内存块装入页面列表2-是否命中/...
缺页次数
其中:
页面变化时内存块装入页面列表:内存块1装入页面,内存块2装入页面,内存块3装入页面...,未装入任何页面时由 -”表示
是否命中:1-命中,0-缺页-Write a request page storage management simulation program, through the page replacement process simulation, to deepen understanding of the requested page storage management basic principles and processes. Requirements: 1. Memory blocks the keyboard to access the page sequence and allocated to the process 2. respectively OPT, FIFO and LRU page replacement algorithm (Note: For OPT algorithm, in case there are multiple pages optional, elimination of early entry into the first page). 3. Calculate the number of page faults and page fault rate. Test format is as follows: Input: Algorithms (1- OPT, 2- FIFO, 3- LRU) memory block sequence number of pages (page 1, page 2, page 3, ...) Output: change the page memory block load page loaded memory block list list of pages that have been hit 1-/2- page changes if hit/... number of page faults wherein: when the page is loaded into memory block change list page: 1 load the page memory block, memory block 2 load the page, the page is loaded ... memo
(系统自动生成,下载前可以参看下载内容)
下载文件列表
subject_3.cpp