java - How can I adjust this this function to FIFO & LRU? -


I'm having some trouble FIFO & amp; LRU , and I'm trying to change my code to those people.

This is my default page: Fault method:

  Private zero PageFull (Int. Page number) {pageFaults ++; Try {pageFile.seek (page number • pages); For (int b = 0; b  

The method works perfectly, but I do not know how I would like it to be FIFA & amp; LRU, like this:

Private Zero Page FaultFIFO (int page number);

Private Zero Page FaultLRU (int page number); <

Explains your FIFO and LRU understanding.

FIFO : The operating system keeps track of all pages in memory in one line, with the most recent arrival on the back, and the oldest arrival in front. When a page needs to be changed, the front page of the queue (the oldest page) is chosen. While FIFA is cheap and intuitive, it performs poorly in practical applications.

For example. If you have 10 shoes and your mother says that any 5 are garbage, then you will choose the oldest 5 to trash out.


LRU : LRU works on the idea that pages which have been used heavily in the last few directions, are likely to use a lot more in the next few directions. .

For example. Here, if you have 10 shoes and your mother says that if someone leaves 5 garbage, then you will make those 5 shoes out of the garbage, which you use less often.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -