01.06.2014 Views

Concurrent Systems II - Bad Request - Trinity College Dublin

Concurrent Systems II - Bad Request - Trinity College Dublin

Concurrent Systems II - Bad Request - Trinity College Dublin

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Page replacement policy<br />

• Least Recently Used (LRU) (Cont’d)<br />

◾ Counter:<br />

• Associate a timestamp variable with each page table entry<br />

• Implement a logical clock that is incremented on every memory access<br />

• Whenever we access a memory page, we update the timestamp in the page table entry with the current logical clock<br />

value<br />

• To replace a page we need to search the page tables to find the least recently used page<br />

• Updates are cheap but searching for a replacement is very expensive<br />

◾ Stack<br />

• Maintain a stack as a doubly linked list of page table entries<br />

• When a page is referenced, move it from its current position in the stack to the top of the stack<br />

• Always replace the page at the bottom of the stack<br />

• Updates are expensive but searching for a victim page is cheap<br />

176<br />

<strong>Trinity</strong> <strong>College</strong> <strong>Dublin</strong><br />

© Mike Brady 2007–2009

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!