Results 1 to 4 of 4
Thread: FIFO sorting
- 07-23-2009, 11:38 PM #1
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
FIFO sorting
Hey all
I have to create a class that illustrates the implementation of FIFO page replacement algorithms on string of value passed in and then record the page faults incurred.
The number of frames that is used is a fixed at 7 and the size of the string will be 20 values.
I was thinking that the best way to create this would be to
Put the string values in an array.
Have a for loop reading values from the array and using a queue to show the FIFO.
Then finally using an if statement to judge if the inserted value is the same as replaced and thus counting up the faults.
Can you suggest if I am going about this the correct way or if there is a more efficient way of carrying this out.
Thanks
- 07-24-2009, 12:14 AM #2
I'm confused.
What do you mean by page faults, frames, and value size?
Is the value size the amount of strings passed in?
- 07-24-2009, 12:28 AM #3
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
By frames i mean that there will be the number of inserts done before the first one has to be removed.
eg. say theres 3 frames
1
1 2
1 2 3
4 2 3
The value size is the amount of numbers i will be using in the string.
eg. there are 6
1,2,3,4,5,6
And a page fault is basically where the number inserted is not the same as the value being replaced
I hope that explains things a bit better
- 07-24-2009, 06:35 AM #4
Member
- Join Date
- Feb 2009
- Posts
- 92
- Rep Power
- 0
sets ?
This is evidently an algorithm that would be used in an OS to obtain a page that is needed in memory, but not present. it is a dynamic process, and of course works because most memory access is to places close to the current address.
I had to something like this over a dozen years ago, but I was using C/C++ and don't remember a lot except that I was using a stack. Doesn't help you, but it would seem that you could use sets, and see if the current page is in the set.
Similar Threads
-
Sorting 3 Integers Using If Else
By MSteinman in forum New To JavaReplies: 12Last Post: 02-19-2010, 12:52 PM -
FIFO communication over a unreliable UDP
By r_rama in forum NetworkingReplies: 1Last Post: 12-21-2008, 09:04 AM -
sorting
By jot321 in forum New To JavaReplies: 18Last Post: 10-02-2008, 10:30 AM -
sorting problem...
By mark-mlt in forum New To JavaReplies: 4Last Post: 04-17-2008, 02:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks