Problems of Chapter 4 - Synchronization in Distributed Systems

Andrew S. Tanenbaum - Prentice Hall - ISBN 0-13-219908-4


1. Name at least three sources of delay that can be introduced between WWV broadcasting the time and the processors in a distributed system setting their internal clocks.

2. Consider the behavior of two machines in a distributed system. Both have clocks that are supposed to tick 1000 times per millisecond. One of them actually does, but the other ticks only 990 times per millisecond. If UTC updates come in once a minute, what is the maximum clock skew that will occur? <\font>

3. Add a new message to Fig. 5.7 that is concurrent with message A, that is, it neither happens before A nor happens after A.

4. To achieve totally-ordered multicasting with Lamport timestamps, is it strictly necessary that each message is acknowledged?

5. Consider a communication layer in which messages are delivered only in the order that they were sent. Give an example in which even this ordering is unnecessarily restrictive.

6. Suppose that two process detect the demise of the coordinator simultaneously and both decide to hold an election using the bully algorithm. What happens?

7. In Fig.5.12 we have two ELECTION messages circulating simultaneously. While it does no harm to have two of them, it would be more elegant if one could be killed off. Devise an algorithm for doing this without affecting the operation of the basis election algorithm.

8. Many distributed algorithms require the use of a coordinating process. To what extent can such algorithms actually be considered distributed? Discuss.

9. In the centralized approach to mutual exclusion (Fig. 5.13), upon receiving a message from a process releasing its exclusive access to the critical region it was using, the coordinator normally grants permission to the first process on the queue. Give another possible algorithm for the coordinator.

10. Consider Fig.5.13 again. Suppose that the coordinator crashes. Does this always bring the system down? If not, under what circumstances does this happen? Is there any way to avoid the problem and make the system able to tolerate coordinator crashes?

11. Ricart and Agrawala's algorithm has the problem that if a process has crashed and does not reply to a request from another process to enter a critical region, the lack of response will be interpreted as denial of permission. We suggested that all requests be answered immediately, to make it easy to detect crashed processes. Are there any circumstances where even this method is insufficient? Discuss.

12. How to the entries in Fig. 5.16 change if we assume that the algorithms can be implemented no a LAN that supports hardware broadcasts?

13. A distributed system may have multiple, independent critical regions. Imagine that process 0 wants to enter critical region A and process 1 wants to enter critical region B. Can Ricart and Agrawala's algorithm lead to deadlocks? Explain your answer.

14. In Fig.5.17 we saw a way to update an inventory list atomically using magnetic tape. Since a tape can easily be simulated on disk (as a file), why do you think this method is not used any more?

15. In Fig. 5.25(d) three schedules are shown, two legal and one illegal. For the same transactions, give a complete list of all values that x might have at the end, and state which are legal and which are illegal.

16. When a private workspace is used to implement transactions on files, it may happen that a large number of file indices must be copied back to the parent's workspace. How can this be done without introducing race conditions?

17. Give the full algorithm for whether an attempt to lock a file should succeed or fail. Consider both read and write locks, and the possibility that the file was unlocked, read locked, or write locked.

18. Systems that use locking for concurrency control usually distinguish read locks from write locks. What should happen if a process has already acquired a read lock and now wants to change it into a write lock? What about changing a write lock into a read lock?

19. With timestamp ordering in distributed transactions, suppose a write operation write(T1,x) can be passed to the data manager, because the only, possibly conflicting operation write(T2,x) had a lower timestamp. Why would it make sense to let the scheduler postpone passing write(T1,x) until transaction T2 finishes?

20. Is optimistic concurrency control more or less restrictive than using timestamps? Why?

21. Does using timestamps for concurrency control ensure serializability? Discuss.

22. We have repeatedly said that when a transaction is aborted, the world is restored to its previous state, as though the transaction had never happened. We lied. Give an example where resetting the world is impossible.


Luís Fernando Faina
Last modified: Wed Dec 3 08:09:22 2003