1.Consider Figure 5.13.Would the meaning of the program change if the following were
interchanged?
a. semWait(e); semWait(s)
b. semSignal(s); semSignal(n)
c. semWait(n); semWait(s)
d. semSignal(s); semSignal(e)
2. In the discussion of the producer/consumer problem with finite buffer (Figure 5.12),
note that our definition allows at most n – 1 entries in the buffer.
a. Why is this?
b. Modify the algorithm to remedy this deficiency. 3. Show that message passing and semaphores have equivalent functionality by
a. Implementing message-passing using semaphores. Hint: Make use of a shared
buffer area to hold mailboxes, each one consisting of an array of message slots.
b. Implementing a semaphore using message passing. Hint: Introduce a separate
synchronization process.