Previous | Next --- Slide 17 of 30
Back to Lecture Thumbnails
mingf

Could someone explain to me why there are O(P^2) interconnect traffic? Here is my understanding: There are O(P) invalidations per lock release and P P processors which are all trying to acquire the lock, do something and release the lock. So there are O(P*P) traffic.

ankit1990

@mingf I think the explanation is correct.

grose

I once wondered why this wasn't the default behavior. Why not just make test-and-test-and-set the default, and maybe have an optional test-and-set?

For one thing, it offers the programmer less granularity by default. I'm also guessing, in a lot of applications, there isn't too much contention hopefully (unlike in asst3)

sgbowen

@grose: But if there's not a lot of contention, it's better to have a simple test and set lock because it results in lower latency by avoiding the extra check (as the slides say).

I think it makes sense that test and test and set isn't the default because it's a specialization of the general case--you don't always want it in every application.

oulgen

This slide says higher latency than test and set but the first test is only read so it grants you shared access and when it passes then you go for the exclusive access. In this situation, honestly how much slower is test and test and set?