The following algorithm (Fig. 5) is for two threads 1 and 2, and it makes use of
Fantastic news! We've Found the answer you've been seeking!
Question:
The following algorithm (Fig. 5) is for two threads 1 and 2, and it makes use of two registers: x which can hold three values (0, 1, and 2); and y which can hold two values (0 and 1). Both threads can read and write registers x and y. The symbol i is used to designate the thread-id, and can be 1 or 2. Figure 5
a. Show that it satisfies mutual exclusion and deadlock-freedom for two threads.
b. Does it satisfy starvation-freedom for two threads?
c. Does it satisfy deadlock-freedom for three threads? That is, i can be 1, 2 or 3.
d. Does it satisfy mutual exclusion for three threads? That is, i can be 1, 2 or 3. For each question, you should either sketch a proof, or display an execution where it fails.
Related Book For
Posted Date: