国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 維修 > 硬盤 > 正文

硬盤Cache寫機制 Write-through與Write-back的區(qū)別

2020-07-05 10:22:21
字體:
供稿:網(wǎng)友

Cache寫機制分為write through和write back兩種。

Write-through- Write is done synchronously both to the cache and to the backing store.
Write-back (or Write-behind) – Writing is done only to the cache. A modified cache block is written back to the store, just before it is replaced.
Write-through(直寫模式)在數(shù)據(jù)更新時,同時寫入緩存Cache和后端存儲。此模式的優(yōu)點是操作簡單;缺點是因為數(shù)據(jù)修改需要同時寫入存儲,數(shù)據(jù)寫入速度較慢。


Write-back(回寫模式)在數(shù)據(jù)更新時只寫入緩存Cache。只在數(shù)據(jù)被替換出緩存時,被修改的緩存數(shù)據(jù)才會被寫到后端存儲。此模式的優(yōu)點是數(shù)據(jù)寫入速度快,因為不需要寫存儲;缺點是一旦更新后的數(shù)據(jù)未被寫入存儲時出現(xiàn)系統(tǒng)掉電的情況,數(shù)據(jù)將無法找回。

Write-misses寫缺失的處理方式 

對于寫操作,存在寫入緩存缺失數(shù)據(jù)的情況,這時有兩種處理方式:

Write allocate (aka Fetch on write) – Datum at the missed-write location is loaded to cache, followed by a write-hit operation. In this approach, write misses are similar to read-misses.
No-write allocate (aka Write-no-allocate, Write around) – Datum at the missed-write location is not loaded to cache, and is written directly to the backing store. In this approach, actually only system reads are being cached.
Write allocate方式將寫入位置讀入緩存,然后采用write-hit(緩存命中寫入)操作。寫缺失操作與讀缺失操作類似。

No-write allocate方式并不將寫入位置讀入緩存,而是直接將數(shù)據(jù)寫入存儲。這種方式下,只有讀操作會被緩存。

無論是Write-through還是Write-back都可以使用寫缺失的兩種方式之一。只是通常Write-back采用Write allocate方式,而Write-through采用No-write allocate方式;因為多次寫入同一緩存時,Write allocate配合Write-back可以提升性能;而對于Write-through則沒有幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 池州市| 胶州市| 道真| 东兴市| 咸阳市| 灵璧县| 大姚县| 育儿| 绍兴县| 蕲春县| 清远市| 巫山县| 错那县| 新疆| 天台县| 宣恩县| 英德市| 遂昌县| 邻水| 尤溪县| 周至县| 佛山市| 宝坻区| 吉首市| 繁峙县| 叙永县| 麻江县| 和林格尔县| 易门县| 崇礼县| 驻马店市| 勐海县| 昌邑市| 桂东县| 梁平县| 庄河市| 济源市| 洪洞县| 通州市| 大同县| 宁阳县|