1 / 22

LRU Algorithm

LRU Algorithm. Least Recently Used. Introduction. The fact that the world is doomed with computer, people’s daily living and how the world works nowadays become more modernized. Yet, this is the external reality in this computer era.

aquarius
Télécharger la présentation

LRU Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LRU Algorithm Least Recently Used

  2. Introduction The fact that the world is doomed with computer, people’s daily living and how the world works nowadays become more modernized. Yet, this is the external reality in this computer era.

  3. We must go deeper by fully understanding the real thing behind the direct usage of computers. The computer world is synthesized, by means of operations done inside for it to function.

  4. There are more instances that troubles occur which we are supposed to solve in order to regulate or stabilize operations.

  5. In order to that, there’s what we call mapping functions which we used to avoid conflict of data processed which involve different replacement algorithms.

  6. One is Least Recently Used (LRU). It used to replace a block that has been in the cache longest with no reference to it. This will be useful to lessen the errors and cache miss.

  7. We are assigned to make a program which executes Least Recently Used (LRU) Algorithm. It used to replace a block that has been in the cache longest with no reference to it. This will be useful to lessen the errors and data traffic.

  8. Statement of the Problem The cache stores some of the data that are transferred from the main memory in order not to search again for it when the same data was again needed.

  9. But there’s this THRASHING where a data that was just removed in the cache is again needed. So, we make use of different replacement algorithms to lessen the error.

  10. LFU considers a counter. FIFO considers time. While LRU considers both time and counter. With these different algorithms, it is hard to know which is the most effective to lessen the errors.

  11. Objectives • To illustrate how Least Recently Used (LRU) Algorithm work. • To understand the logical operations done behind the level of the computer user. • To know and understand the significance of using LRU.

  12. Objectives(cont) • To know what is easier to use between LFU,LRU or FIFO. • To prove that LRU is effective in lessening error and data traffic.

  13. Significance of the Study Knowing and understanding LRU allows us to use the algorithm properly in order for us to achieve the objectives and solve the statement of the problem.

  14. We will be able to differentiate the said algorithm with the other types and for us to identify its strength and weakness in order to select the appropriate algorithm to be used.

  15. Process Least Recently Used (LRU) Algorithm • When a new block is stored in the cache, LRU replaces the block that has not been used for the longest period of time.

  16. Divide the main memory block by the number of sets. The remainder determines which set it would belongs.

  17. b) Every time a block is stored, the time increases. But if there is a cache hit, the counter will be incremented.

  18. c) It would compare the counter of the other blocks in that set and replaces the one with the least counter. d) But if there are two blocks with the same counter, it will then consider the time and replaces the one with the longest time.

  19. Example: MM Blocks: 1,2,3,4,1,5,5,7,6,4

  20. Conclusion Compared to LFU and FIFO, LRU is harder to implement because it considers both time and counter. On the other hand, it is more effective than the other two because there is less thrashing during the process.

  21. Understanding and applying the concepts of LRU Algorithm is very useful and contributed a lot for us to come up a program which executes the said algorithm.

  22. THANK YOU ! Prepared by : Balatico, Rey Steve P. Bibit, Mae Rose Arce, Crissel Lyka Q. Coloma, Madeline C. Lacar, Larissa Vivien S. Manglal-lan, Rizaldy Jr. Salacup, Kathleen Soriano, Ethelyn Joyce BSCS II-A

More Related