Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a simulator program that will enable you to compare and contrast the operation of various page replacement strategies discussed in class ( plus an

Develop a simulator program that will enable you to compare and contrast the operation of various page replacement strategies discussed in class (plus an additional page replacement algorithm discussed here). For a given page reference string, your program will output the number of page faults for a given page replacement algorithm. The name of your executable must be "simpager".
Input to your program will be from standard input. There is to be no "user prompts" in your program. Program output will be to standard output. Your program must follow a standardized input format. The first line is the page reference string. Each number in the page reference string is separated by whitespace and is terminated by a new line. The page reference string is on 1(one) and only 1(one) line. The second line is the number of frames allocated to a specific process. The remaining lines will be string mnemonics; one for each page replacement algorithm.
Output from your program will be the following. Echo the page reference string up to 20 page references per line. Echo the number of frames allocated to the process. Print the page replacement algorithm "mnemonic" and the number of page faults. Although your program reads from standard input and writes to standard output, it is suggested that you have several program data files that you can re-direct standard input and thus have your program read.
Example Input:
70120304230321201701
3
FIFO
LRU
Example Output:
% simpager < testcase1.txt
Page Reference String:
70120304230321201701
Number of Frames: 3
FIFO: 15
LRU: 12
The page replacement algorithms and their respective mnemonics to be implemented are the following:
FIFO - First in first out page replacement. See text for description.
LRU - Least recently used page replacement See text for description.
OPT - Optimal page replacement. See text for description.
RAND - Random page replacement. This is an easy to implement, low-overhead page replacement strategy. Under this strategy, each page in main memory has an equal likelihood of being selected for replacement. One problem with RAND is that it may accidentally select as the next page to replace the page that will be referenced next. A benefit of RAND is that it makes replacement decisions quickly and fairly. However, because of this "hit-or-miss" approach, RAND is rarely used in practice.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions