Cache coherence multi step instruction8/28/2023 Write-back caches, yeah they're optimization. Maybe this is just a problem with write-back. And it's because we have two caches that we get stale values either in other caches or in main memory. And we can see that it is because we have, caches here that this problem exists. ![]() But also just to use this system, you know, how do you know when the value has been updated and is shown. ![]() Now we have three different values and this is going to cause problems for both our memory consistency model. More to the point, what happens if CPU-2 tries to go update cache-2 here with a value 300, we'll say. Now where does this become a problem? Well CPU-2 never sees the value that got updated for address A. So, if CPU-2 tries to go read address A, it's going to continually just get the old value. The newest values here, is going to be 200, but here in memory and here in the cache 2, we have the old value. Well, all of a sudden we have a stale value. Okay, so what happens to the values in memory and in cache-2? Hmm. The first is in the write-back case, so all the caches here are write-back. Okay? So, let's look at this in, in two cases. Now, let's say, let's suppose, that CPU-1 updates address A to value 200. So, let's say, at address A here, we start off with everyone having the value of 100 in their respective caches and main memory. So, let's, let's take a look at what, what happens in this basic, basic example. Or temporarily, recently or has spatial locality with some other reference that you've done recently. To go access some piece of data that you've accessed either temporarily. because you don't have to go communicate with the distant memory. Now, why do we want a cache? Well, we've discussed this in great detail in this class that, caches make your program go faster. So here we show a little bit of an example here which has two CPUs. So let's take a look at the problems with having a bus and actually, the bigger problems with having a cache.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |