Previous | Next --- Slide 41 of 66
Back to Lecture Thumbnails
yuel1

Is it also considered a stall if a process cannot advance because it is waiting for a lock to be released?

kayvonf

My answer to this question depends on some knowledge of how the locks are implemented, so ignore this response until later in the course if need be. Our use of the term "stall" assumes we're talking at the level of the HW. A thread stalls if the next instruction in the stream cannot be executed because of a dependency on a previous instruction whose results are not yet known. If the thread is "spinning" on a lock, it's continually issuing instructions to check if the lock is free. While not making any meaningful progress, from the processor's perspective the thread is running and not stalled.