#include <msa-DistPageMgr.h>
Public Member Functions | |
vmLRUReplacementPolicy (unsigned int nPages_, const std::vector< ENTRY_TYPE * > &pageTable_, const std::vector< pageState_t * > &pageState_) | |
void | pageAccessed (unsigned int page) |
Note that a page was just accessed. | |
unsigned int | selectPage () |
Ask for the index of a page to discard. | |
Protected Types | |
typedef MSA_Page_StateT < ENTRY_TYPE, ENTRIES_PER_PAGE > | pageState_t |
Protected Attributes | |
unsigned int | nPages |
const std::vector< ENTRY_TYPE * > & | pageTable |
const std::vector< pageState_t * > & | pageState |
std::list< unsigned int > | stackOfPages |
unsigned int | lastPageAccessed |
It needs to be notified when a page is accessed using the pageAccessed() function and a page can be selected for replacement using the selectPage() function.
WARNING: a list is absolutely the wrong data structure for this class, because it makes *both* updating as well as searching for a page O(n), where n is the number of pages. A heap would be a better choice, as both operations would then become O(lg(n))
Definition at line 262 of file msa-DistPageMgr.h.
typedef MSA_Page_StateT<ENTRY_TYPE, ENTRIES_PER_PAGE> vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageState_t [protected] |
Definition at line 267 of file msa-DistPageMgr.h.
vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::vmLRUReplacementPolicy | ( | unsigned int | nPages_, | |
const std::vector< ENTRY_TYPE * > & | pageTable_, | |||
const std::vector< pageState_t * > & | pageState_ | |||
) | [inline] |
Definition at line 273 of file msa-DistPageMgr.h.
void vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageAccessed | ( | unsigned int | page | ) | [inline, virtual] |
Note that a page was just accessed.
Implements MSA_PageReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >.
Definition at line 278 of file msa-DistPageMgr.h.
unsigned int vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::selectPage | ( | ) | [inline, virtual] |
Ask for the index of a page to discard.
Implements MSA_PageReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >.
Definition at line 294 of file msa-DistPageMgr.h.
References MSA_INVALID_PAGE_NO.
unsigned int vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::nPages [protected] |
Definition at line 265 of file msa-DistPageMgr.h.
const std::vector<ENTRY_TYPE *>& vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageTable [protected] |
Definition at line 266 of file msa-DistPageMgr.h.
const std::vector<pageState_t *>& vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageState [protected] |
Definition at line 268 of file msa-DistPageMgr.h.
std::list<unsigned int> vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::stackOfPages [protected] |
Definition at line 269 of file msa-DistPageMgr.h.
unsigned int vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::lastPageAccessed [protected] |
Definition at line 270 of file msa-DistPageMgr.h.