Coder Social home page Coder Social logo

frhd143 / fifo-page-replacement-algorithm Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 124 KB

This is an implementation of the First In First Out (FIFO) page replacement algorithm.

License: MIT License

C 100.00%
algorithm fifo-page-replacement firstinfirstout memory operating-system page-replacement-algorithm pagereplacement

fifo-page-replacement-algorithm's Introduction

First In First Out Page Replacement Algorithm - FIFO

This is an implementation of the First In First Out (FIFO) page replacement algorithm.

Overview

This is a C program that implements the First In First Out (FIFO) page replacement algorithm. The program reads a file containing a list of memory references, and simulates how the memory management system would operate with a given number of physical pages and page size.

Usage

The program calculates the number of page faults for a sequence of memory references (i.e., the memory reference trace in the .mem-files) when using the FIFO (First-In-First-Out) page replacement policy.

The program takes the number of physical pages, the page size, and the name of the trace file:

./fifo no_phys_pages page_size filename

The program then returns the resulting number of page faults for that specific combination of number of pages and page size, for either mp3d.mem or mult.mem. Example execution:

 ./fifo 4 256 mp3d.mem

Output:

No physical pages = 4, page size = 256
Reading memory trace from mp3d.mem... Read 100000 memory references
Result: 11940 page faults

Contributing

Contributions to this project are welcome. If you find a bug or want to suggest an improvement, please open an issue or submit a pull request. Or email me here: [email protected]

License

This code is released under the MIT License.

fifo-page-replacement-algorithm's People

Contributors

frhd143 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.