Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 20th, 2005, 11:32 AM   #1
redhatter
Newbie
 
Join Date: Nov 2005
Posts: 1
Rep Power: 0 redhatter is on a distinguished road
Page Replacement Program (C++)

Create text data file
-- pages.dat--
22//length of the page reference string (dynamic array)
1,2,4,1,5,3,1,2,5,6,7,4,5,4,6,2,1,2,8,3,4,8
1,2,4,3//number of frames

comments part of data file

implement FIFO and LRU page replacement algorithms

read text file once, keep data in array

1st array - page reference string

2nd array - number of strings

output: FIFO
number of page faults w/ 1 frame =
number of page faults w/ 2 frames =
number of page faults w/ 4 frames =
number of page faults w/ 3 frames =

function will take 2 parameters (string and number of frames), it should produce number of page faults

don't develop a different code for each frame, just a single function

1 function for FIFO
1 function for LRU

as modular as possible
no global variables
has to be functional/structured

should work for any amount of data (any number of frames, any page reference string)

could you guys write and post the code for this, I would like to study the code.
redhatter is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:06 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC