Previous | Next --- Slide 23 of 66
Back to Lecture Thumbnails
nassosterz

Benefit of this implementation is that the spin occurs on read and not on test and set, which means that the spin is on cache hits and no writes are required, unless another thread releases the lock when at this moment, only one test and set occurs => less interconnection traffic.

jkuro

@nassosterz well put. The other threads are stuck in BusRd instead of BusRdx.This means that there's less bus traffic or "shouting along the bus"

spendharkar

Since multiple caches can have a cache line in the S-state (only reading the value) this version doesn't generate as much interconnect traffic. After doing one BusRdX the reads result in cache hits. With test-and-set each time, there was a cache that was moving the cache line into the M-state which results in invalidating the lines from other caches (resulting in cache misses)

chenyecharchar

spinning on S both avoids invalidating others' cache and allow processor to have cache hits in its own cache

Please log in to leave a comment.