页面置换算法的模拟实现和计算命中率

所属分类:操作系统开发
开发工具:C/C++
文件大小:26KB
下载次数:234
上传日期:2005-05-31 20:30:57
上 传 者zelosor
说明:  基本算法思想 OPT:该算法的基本思想是用二维数组page2[40][2] 的第一列存储装入内存的页面,而第二列用作标记位计数器。每当发生缺页时,就从内存中调出一页,首先将内存中的页面一一与要调入内存中的页面之后的页面比较,如果两个页面不相等,则内存中相应的页面的标记位计数器加一,直至到有相等的页面,则该页面的比较停止,再重复以上操作,直至内存中的页面全部比较完。然后找出内存中页面的标记位最大的页面,而该页就是要置换出来的页。 FIFO: 该算法的基本思想是用队列queue存储内存中的页面,队列的特点是先进先出,与该算法是一致的,所以每当发生缺页时,就从队头删除一页,即队头指针加一,而从队尾加入缺页,队尾指针加一。 LRU: 该算法的基本思想是用二维数组page2[40][2] 的第一列存储装入内存的页面,而第二列用作标记位计数器。每当使用页面时,该页面的标记位计数器加一。发生缺页时,就从内存中页面标记最小的一页,调出该页,并且该页后面的页面在数组中的位置前移,而缺页就放在数组后面。
(basic algorithm thinking OPT : The basic idea of the algorithm is a two-dimensional array page2 [40] [2], the first storage pages loaded into memory, and the second for the markers out counter. Whenever there are missing pages, from memory a redeployment, the first memory pages on January 1 and transferred to the memory page after page, two pages, if not equal, then the corresponding memory pages marked increase a bit counter, until the equivalent of a page, the page more stop and then to repeat the operation, until the memory of all the pages compared End. Then find memory pages marking the largest-page, the page is to the replacement page. FIFO : The basic idea of the algorithm is used queue queue storage memory pages, and the queue is FIFO features, and the algorithm is the same, so whe)

文件列表:
页面置换算法的模拟实现和计算命中率\PERMUT~2.EXE (39747, 2004-12-23)
页面置换算法的模拟实现和计算命中率\RESULT.TXT (3627, 2004-12-23)
页面置换算法的模拟实现和计算命中率\permutation .C (6770, 2004-12-23)
页面置换算法的模拟实现和计算命中率 (0, 2005-05-31)

近期下载者

相关文件


收藏者