Homework 2

Assigned: Feb. 11
Due: Feb. 20

Problem 1

Suppose that the operations on mutex are omitted from the solution to the readers/writers problem (Tanenbaum, p. 129, figure 2-34).

Problem 2

Consider the following sychronization problem: There are three processes, P, Q, and R. All three are executing a loop from 1 to N. You wish to enforce the condition that no process may enter the (I+1)st iteration until the other two processes have completed the Ith iteration. Show how this condition can be enforced using three semaphores.