Skip to content

Commit

Permalink
增加替换算法
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcaffebabe committed Feb 8, 2020
1 parent 945c83c commit 261196d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Binary file added assets/批注 2020-02-08 191721.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/批注 2020-02-08 191910.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/批注 2020-02-08 192722.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions 计算机系统/程序结构和执行/存储器层次结构.md
Expand Up @@ -306,6 +306,26 @@ DRAM与SRAM不同的是,需要间隔一段时间执行刷新操作
- Cache共n组,主存第j块号映射到Cache 的组号为:i=j mod n
- 即主存的数据块映射到Cache特定组的任意行

### 替换算法

程序运行一段时间后,Cache存储空间被占满,当再有新数据要调入时,就需要通过某种机制决定替换的对象

#### 先进先出法-FIFO

![批注 2020-02-08 191721](/assets/批注%202020-02-08%20191721.png)

#### 最不经常使用法---LFU

![批注 2020-02-08 191910](/assets/批注%202020-02-08%20191910.png)

#### 近期最少使用法--- LRU

![批注 2020-02-08 192722](/assets/批注%202020-02-08%20192722.png)

#### 替换算法的抖动

- 刚刚淘汰的块在下一时刻又被访问...

## 缓存写

## 高速缓存参数的性能影响
Expand Down

0 comments on commit 261196d

Please sign in to comment.