Previous | Next --- Slide 62 of 73
Back to Lecture Thumbnails
kayvonf

Question: This is an important slide, since the need for mutual exclusion comes up many times in coordinating multiple threads.

(1) Can you describe the problem that occurs in the slide above? Two threads are trying to add 1 to the value of a shared variable diff.

(2) What is the property of mutual exclusion and how does it solve the problem?

(3) How can a programmer create a situation of mutual exclusion using locks?