PPL Logo

vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE > Class Template Reference

class vmLRUPageReplacementPolicy This class provides the functionality of least recently used page replacement policy. More...

#include <msa-DistPageMgr.h>

Inheritance diagram for vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >:

Inheritance graph
[legend]
Collaboration diagram for vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >:

Collaboration graph
[legend]

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 intstackOfPages
unsigned int lastPageAccessed

Detailed Description

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
class vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >

class vmLRUPageReplacementPolicy This class provides the functionality of least recently used page replacement policy.

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.


Member Typedef Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
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.


Constructor & Destructor Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
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.


Member Function Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
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.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
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.


Field Documentation

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
unsigned int vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::nPages [protected]

Definition at line 265 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
const std::vector<ENTRY_TYPE *>& vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageTable [protected]

Definition at line 266 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
const std::vector<pageState_t *>& vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::pageState [protected]

Definition at line 268 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
std::list<unsigned int> vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::stackOfPages [protected]

Definition at line 269 of file msa-DistPageMgr.h.

template<class ENTRY_TYPE, unsigned int ENTRIES_PER_PAGE>
unsigned int vmLRUReplacementPolicy< ENTRY_TYPE, ENTRIES_PER_PAGE >::lastPageAccessed [protected]

Definition at line 270 of file msa-DistPageMgr.h.


The documentation for this class was generated from the following file:

Generated on Mon Sep 21 08:31:42 2020 for Charm++ by  doxygen 1.5.5