Giter Club home page Giter Club logo

page-replacement-simulation's Introduction

page-replacement-simulation

Description of Implementations:

FIFO: FIFO uses an array and a circular buffer to handle page replacement. If the page table is not full and the page is not already in the page table, pages are added to the page table as they are requested. If the page table is full and the page is not already in the page table, the new page is put at the end of the beginning of the circular buffer, and the head of the buffer moves to the next index of the array so that the position right after where this new page was inserted is the new beginning of the buffer.

LRU: LRU uses a linked list to replace the least recently used page in a page table. Every time a new page is requested, the node associated with that page becomes the head of the linked list. If the page already exists as a node in the linked list, it is also changed to become the head of the linked list when its page is requested. When the page table is full, since the linked list orders itself with each request, the least recently used page’s node is already at the end of the linked list. So, the tail of the linked list is removed.

LFU: LFU uses two arrays that are linked by their index as a page table. One array stores the frequency of a page’s requests and the other stores the value of the page. Every time a new page is requested, that page’s frequency increases. When the page table is full, a new page will be inserted where the least frequently used page is indexed. If the page table is not full, the arrays will be filled as the pages are requested.

RAND: This algorithm uses an array as its page table. When the page table is full, an index of the array is randomly chosen. This is done by assigning a random number, modded to reside within the range of the page table, to an index variable. The page residing at that index is replaced by the new page.

page-replacement-simulation's People

Contributors

rachgoldstein avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

koookee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.