Question: Note: Please write code in C++ This is the Pseudocode below Loop for 1,000 experiments Generate a memory trace Loop for working set size from

Note: Please write code in C++

This is the Pseudocode below

Loop for 1,000 experiments

Generate a memory trace

Loop for working set size from 2 through 20

Faults[working set size][LRU] += LRU( working set size, trace )

Faults[working set size][FIFO] += FIFO ( working set size, trace )

Faults[working set size][Clock] += Clock ( working set size, trace )

Faults[working set size][Random] += Random ( working set size, trace )

End of working set size loop

End of Experiment loop

Loop for working set size from 2 through 20

Test trace with:

Print( working set size,

Faults[working set size][LRU] / 1000.0,

Faults[working set size][FIFO] / 1000.0,

Faults[working set size][Clock] / 1000.0,

Faults[working set size][Random] / 1000.0 )

End of working set size loop

External to the program, generate a plot which depicts the performance of each of the algorithms.

Generate a memory trace

Each memory trace is 1,000 addresses.

Loop over parts from 0 to 9

Base address equals 25 times a uniform random value in [0,99], inclusive.

Index over addresses within part from 0 to 99.

Address[100*part+index] = Base + uniform random in [0,49], inclusive.

Instructions: You can follow the slides below to further understand the step and algorithmNote: Please write code in C++ This is the Pseudocode below Loop

for 1,000 experiments Generate a memory trace Loop for working set size

from 2 through 20 Faults[working set size][LRU] += LRU( working set size,

trace ) Faults[working set size][FIFO] += FIFO ( working set size, trace

) Faults[working set size][Clock] += Clock ( working set size, trace )

Faults[working set size][Random] += Random ( working set size, trace ) End

of working set size loop End of Experiment loop Loop for working

Basic Algorithms Algorithms used for the selection of a page to replace: . Optimal Least recently used (LRU) First-in-first-out (FIFO) . Clock Basic Algorithms Algorithms used for the selection of a page to replace: . Optimal Least recently used (LRU) First-in-first-out (FIFO) . Clock

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!