In programming assignment #4 you are to transcribe a airs of a page
reinstatement retrospect treatment classification. You earn be utensiling meanest
recently used (LRU) and rst-in-rst-out (FIFO) page reinstatement machinations
(Chapter 8, pg 369).
Your program should decipher from a le to get notification about the se-
quence of page faults that capture-place. I earn stipulate a primal sample of such a
extract le. It consists solely of one integer rate per direction, which resemble a
succession of page faults that capture-place in the airs. For sample:
----------- Begin Input File pagestream.txt --------
------------ End Input File -------------------------
represents the succession of page oration faults/requests for the Figure
8.15 sample from our extract work.
Your program should decipher 3 pieces of notification from the command
line: airs le call, reinstatement machination [lru or fo], and the enumerate
of corporeal creates in retrospect. For sample:
$ p3.exe pagestream.sim lru 3
To get you afloat, I feel comprised a ocean() business and a ocean event
loop in a le named p3-start.cpp, that can disclosed and decipher in the page tendency
le into an rank. Your ocean job is to utensil the meanest recently used
(LRU )and rst-in-rst-out FIFO page reinstatement algorithms. The FIFO
page reinstatement should be the simplier of the two, so I would propose you
get that machination launched rst. In FIFO, of progress, when there is a page
allusion 'miss', you solely need to support a pointer or renunciation into your creates
indicating the next corporeal create enumerate that should be replaced.
Your program should capture the involved tendency of page orationes (a le
name) as the rst parameters. The relieve parameter indicates the total
enumerate of creates that the classification is simulating (in the over sample this
is 3, the identical as the sample shown in Figure 8.15). Your utensila-
tion should be operative to counterfeit classifications delay up to 10 corporeal creates at a
The output for your airs should be formatted in correspondently the fol-
lowing format. To get fit output format and rectify answers for the
include pagestream.sim input le, seem at the results in the zip le named
pagestream-lru-3.out and pagestream-fo-3.out.
Hit ratio: 0 / 12 (0)
Hit ratio: 0 / 12 (0)
Hit ratio: 1 / 12 (0.0833333)
To decipher, for each page allusion in the pagestream, you earn sculpture out
the term, the page that was allusiond (term starts at 0), the Page allusion
that was made at that term, and the set-forth of the classification creates following that
page is processed.
If you use the pagetendency succession from gure 8.15 delay a classification create
size of 3 you should be operative to exhibit the LRU and FIFO results shown.
I feel given you sample rectify outputs for twain FIFO and LRU page
replacement, for classifications delay twain 3 and 4 corporeal creates of retrospect. Use
these rectify sample outputs to experience that your utensilation is launched
correctly. I earn experience your program using dierent pagetendency successions and
dierent classification create sizes, so form abiding you completely experience your algorithm
yourself precedently submitting.