CS 6/73201 "Advanced Operating Systems" HOMEWORK #2 Due in class on 11/01/2006 The numbers in parenthesis refer to "Introduction to Distributed Algorithms" (IDA) 1. Notice that the size of the matrix clock is quadratic with respect to the system size. Propose a technique similar to that of Singhal-Kshemkalyani to decrease the information transmitted and stored if the clocks do not change frequently. 2. Apply Shavit-Francez termination algorithm to the tree based A B \ / C | D / \ E F wave algorithm. Explain how it can run, show a possible computation of the tree algorithm and Shavit-Francez termination detection on top of it. 3. (AOS 6.2) Show that in Lamport's mutual exclusion algorithm, if process Pi is in the CS, then Pi's request may not be at the top of the request queue of another process Pj. Is it still true when there are no messages in transit? 4. Show that in the Ricart-Agrawala's algorithm, the critical section is accessed according to the increasing order of timestamps (discuss why it is impossible for the CS to be granted out of timestamp order). Give an example (draw diagrams) where the CS is granted out of timestamp order in Maekawa's algorithm 5. Discuss why FAILED message is needed in Maekawa's algorithm. Give an example (draw diagrams) where the algorithm performs incorrectly if FAILED message is not used. 6. Suzuki-Kasami DMX algorithm requires that the token carries an array of the number satisfied requests (LN) for each process. Since the unsatisfied requests are stored in a queue (Q) held by the token would it be possible to determine which requests are satisfied and dispense with the array LN altogether? Explain your answer. 7. Consider the network structure below. The processes are executing Raymond's token circulation DMX algorithm. Process A initially holds the token and processes C,D and E are in CS contention. Is it possible that requesting processes enter critical section in the following order D,C,E? Explain your answer. Draw a sequence of diagrams outlining the possible computation. oA / \ oB oC / \ oD oE 8. The philosophers are social and only eat in the company of their neighbors. Arbitrary topology. Philosophers alternate between thinking, and eating (there is no getting hungry state - as soon as the philosopher becomes hungry, the philosopher starts to eat). However, as the philosophers eat, they look at each other (the application controls when the process gets into critical section, the solution controls how long the process can remain in the critical section). One assumption is that if a philosopher is eating, eventually, its every neighbor will be eating as well. Propose a solution that ensures the following two properties: a. If a philosopher is eating, it can stop eating only if all of its neighbors are eating. b. An eating philosopher eventually stops. Note, that the computations of a solution are always infinite. Think as to why.