[转]cache操作方式

1.前言

本文主要介绍cache相关的操作方式,包括:

read through,  read allocate, write through, write back, write allocate

2. CPU读Cache

●若hit,则CPU直接从Cache中读取数据即可。

●若miss,有两种处理方式:

   >Read through,即直接从内存中读取数据;

   >Read allocate,先把数据读取到Cache中,再从Cache中读数据。

3. CPU写Cache

●若hit,有两种处理方式:

    >Write through:把数据同时写到Cache和内存中;

    >Write back:先把数据写到Cache中,再通过flush方式写入到内存中。

●若miss,有两种处理方式:

    >Write allocate:先把要写的数据载入到Cache中,写Cache,然后再通过flush方式写入到内存中;

    >No write allocate:直接把要写的数据写入到内存中。

 4.参考文献

[1] http://blog.csdn.net/steven_yan_2014/article/details/42101757
0
posted @ 2017-08-11 10:16  jasonactions  阅读(243)  评论(0)    收藏  举报