78.8k views
5 votes
In fully-associative cache, what happens if all blocks are already in use?

1 Answer

6 votes

Final answer:

In a fully-associative cache, when all blocks are in use, a cache replacement algorithm determines which block to replace to make room for new data. This could involve writing modified data back to the main memory or discarding unchanged data.

Step-by-step explanation:

In a fully-associative cache, when all blocks are already in use, and a new data needs to be loaded, the cache must replace one of the existing blocks. This is typically managed by a cache replacement algorithm, such as Least Recently Used (LRU), Random Replacement, or First In First Out (FIFO), among others. These algorithms help to decide which block to replace based on specific criteria, aiming to minimize the likelihood of replacing data that will be needed again soon. When a block is selected for replacement, the data it contains is either written back to main memory if it has been modified (write-back policy), or discarded if it has not been changed (write-through policy), making room for the new data block.

User MShekow
by
7.9k points