Previous | Next --- Slide 13 of 83
Back to Lecture Thumbnails
shivalgo

just reading won't be a race condition. It needs at least 1 write to have a race condition. If threads T1 and T2 just read into registers there will be no race in this program.

yt1118

The reason we need mutual exclusions is the instructions are not atomic. One possible interleaving as mentioned in this slide can let x end up with 1, but it should be 2 if working atomically.

gsamp

We want T1 and T2 to agree on the value of r1.

More generally, we want the multithreaded programs to produce the same output as it would had it been executed sequentially.

Please log in to leave a comment.