Course No. : CS ZG623 Course Title : ADVANCED OPERATING SYSTEMS Nature of Exam : Open Book Weightage : 60% Duration : 3 Hours Date of Exam : 30/03/2008 (AN) Note: 1. Please follow all the Instructions to Candidates given on the cover page of the answer book. 2. All parts of a question should be answered consecutively. Each answer should start from a fresh page. 3. Mobile phones and computers of any kind should not be brought inside the examination hall. 4. Use of any unfair means will result in severe disciplinary action.
Q.1 (a). Using Chandy-Lamport global state recording algorithm, record a consistent global state for the below depicted (figure 1) distributed system. Arrows show the communication channels. Assume that a distributed banking application runs in all these systems. Sites A, B, and D maintain three bank accounts named as A, B, and D respectively with $500 as the initial balance in each. Here, you may be interested in computing the net balance of all three accounts by recording a consistent global state. Assume that at time t 1 , using the direct channels, account A transferred $100 to B and another $100 to D, and D transferred $50 to B. At time t 2 (the next time interval), D transferred $200 to B via site C, and initiated the global state recording algorithm. Run the algorithm manually, and record a consistent global state for this scenario. Clearly show all the messages (both computation and marker) and the collected global state. [12]
Q.1 (b). Birman-Schiper-Stephenson (BSS) protocol is a broadcast protocol used for causal ordering of messages. What consequence a communication failure (only link failure) has on this protocol? Explain by giving an example. [3]
Q.2 Ricart-Agrawalas distributed mutual exclusion algorithm has the problem that if a process has crashed and does not reply to a request from another process to enter into a critical region, the lack of response will be interpreted as denial of permission. One way you can handle this is, all requests be answered immediately, to make it easy to detect crashed processes. Are there any circumstances where even this approach is insufficient? Discuss. [10] (Please Turn Over) A B C D $500 $500 $500 (Fig.1) No. of Pages = 3 No. of Questions = 5
CS ZG623 (EC-2 REGULAR) SECOND SEMETER 2007-2008 PAGE 2
Q.3 Given below are three processes P1, P2, and P3 executing concurrently. The data items (variables x, y, and z) are stored in a distributed shared sequentially consistent memory (data store). Assume that each variable is initialized to 0. All statements are indivisible. Here, an assignment corresponds to a write operation and a print statement corresponds to a simultaneous read.
Viewing the concatenated output of P1, P2, and P3 in that order, will the output 001110 be a legal output if the above concurrent execution runs on a sequential consistent memory? If yes, give the interleaving. If no, explain why not. [10]
Q.4 (a). Assume that you have been hired by www.seti.com to design and implement a two level distributed scheduler - first is a super scheduler which is a centralized scheduler and the second is a local scheduler on each node. On receipt of jobs the super scheduler looks at the resources available on different nodes within the distributed system and also finds out which node can give quickest result for a particular job, and then schedule jobs on different nodes on the distributed system. Describe any two problems that you may foresee in this type of scheduling? How would you solve these problems? Explain. [5]
Q.4 (b). Is node P allowed to send messages related to the application (as opposed to message that are part of the checkpoint algorithm itself) immediately after having taken a tentative checkpoint? If so, explain why this is permitted. If not, give an example that illustrates why P should not be allowed to do so and state a condition that defines when P might resume sending messages related to the application. [5]
Q.4 (c). Instead of using a distributed deadlock detection algorithm that exchanges messages, we may be able to handle deadlocks in distributed systems simply by using timeouts, where a process that has waited for a specified period for a resource declares that it is deadlocked (and begin to resolve the deadlock). What are the potential problems in using this method? For each potential problem, give a concrete example that illustrates the problem. [5]
Q.5 (a). Consider three processes depicted in figure 2. The processes run on different machines, each with its own clock, running at its own speed. As you can see from the figure, when the clock has ticked 6 times in P1, it has ticked 8 times in P2, and 10 times in P3. Each clock runs at a constant rate, but the rates are different due to differences in the crystals. Using Lamports logical clocks, correct the clocks of figure 2 processes. [5]
(Please Turn Over) x = 1 y=1 z=1 print(y,z) print(x,z) print(x,y) Process P1 Process P2 Process P3
CS ZG623 (EC-2 REGULAR) SECOND SEMETER 2007-2008 PAGE 3
Q.5 (b). In the following Transaction Wait for Graph, use Obermarcks Path pushing algorithm to build local WFGs, and also show the Path (Cycles) that will be transmitted by each site to detect a deadlock if any. [5]
********
P1 P2 P3 Time Space (Fig.2) S1 S2 S3 P2 P1 P3 P4 P5 P6 P7 P8 P9 (Fig.3)