Question: Consider the following program, which attempts to use a pair of semaphores for mutual exclusion. A. Draw the progress graph for this program. B. Does
Consider the following program, which attempts to use a pair of semaphores for mutual exclusion.

A. Draw the progress graph for this program.
B. Does it always deadlock?
C. If so, what simple change to the initial semaphore values will eliminate the potential for deadlock?
D. Draw the progress graph for the resulting deadlock-free program.
Initially: s= 1, t = 0. Thread 1: P(s); V(s); P(t); V(t); Thread 2: P(s); V(s); P(t); V(t);
Step by Step Solution
3.25 Rating (146 Votes )
There are 3 Steps involved in it
A The progress graph for the original program is shown in Figure 1248 Figure 1248 B The program al... View full answer
Get step-by-step solutions from verified subject matter experts
