WRITE-INVALIDATE AND WRITE-UPDATE POLICIES






Snooping protocol is a protocol which maintains cache coherence in symmetric multiprocessing environments



WRITE VALIDATE


The processor that is writing data causes copies in the caches of all other processors in the system to be rendered invalid before it changes its local copy. The local machine does this by sending an invalidation signal over the bus, which causes all of the other caches to check for a copy of the invalidated file. Once the cache copies have been invalidated, the data on the local machine can be updated until another processor requests it.


WRITE-UPDATE

The processor that is writing the data broadcasts the new data over the bus (without issuing the invalidation signal). All caches that contain copies of the data are then updated. This scheme differs from write-invalidate in that it does not create only one local copy for writes.





STATES


Valid state:

  • All processors can read safely.
  • Local processor can also write.
Invalid state

  • Block being invalidated
  • Block being replaced
  • When a remote processor writes to its cache copy, all other cache copies become invalidated.






CACHE EVENTS AND ACTIONS

Following events and actions occur on the execution of memory-access and invalidation commands −
Read-miss:When a processor want to read a block and it is not in the cache, a read-miss occurs. This initiates a bus-read operation.if no dirty copy exists, then the main memory that has a consistent copy, supplies a copy to the requesting cache memory. If a dirty copy exists in a remote cache memory, that cache will restrain the main memory and send a copy to the requesting cache memory. In both cases cache copy will enter valid state after a read miss.

Write hit: If the copy is in dirty or reserved state, write is done locally and the new state is dirty. If the new state is valid, write invalidate command is broadcasted to all the caches, invalidating their copies. When the shared memory is written through, the resulting state is reserved after this first write.

Write miss: If a processor fails to write in the in the local cache memory, the copy must come either from the main  memory or from a remote cache memory with a dirty block. This is done by sending a read-invalidate command, which will invalidate all cache copies. Then the local copy is updated with dirty state.

Read hit: Read hit is always performed in local cache memory without causing a transition of state or using the snoopy bus for invalidation.

Block replacement: When a copy is dirty, it is to written back to the main memory by block replacement method. However, when the copy is either valid or reserved  state, no replacement will take place.

Comments