Thursday 26 April 2012

Page Replacement in c ,A simulation

Least recently used: download code here
Optimal page replacement : download code here
First come first out: download code here
A shell script for providing graphs of the page replacement is also provided
in case you dont want to use it ,modify the codes above accordingly

The shell script being



#!/bin/sh

gnuplot -persist <<PLOT

plot 'a' using 1:2 title 'page replacement' with lines;set xlabel 'time'; set ylabel 'fault'

quit
PLOT




Save the above in a text file as plo.sh (or any other name for that you may need to modify the name as well in the c codes above)

<The explanation for the above codes will be provided shortly >

No comments:

Post a Comment