You are on page 1of 3

CS 403/534 – Distributed Systems Spring 2003

Sample Examination

Processes

1. In this problem, you are to compare the performances of a single-threaded file server and
a multithreaded file server. Assuming that the data needed are in a cache in main memory,
it takes 15 ms to get a request for reading a file. If the file is not in the main memory (as a
disk operation is needed), as is the case one-third of the time, an additional 75 ms is
required, during which time the thread blocks. How many requests/sec can the server
handle if it is single threaded and if it is multithreaded?

2.
a. Statically associating only a single thread with a lightweight process is not such good
idea. Explain why not.
b. Associating all the threads with only a single lightweight process is also not such a
good idea. Explain why not.

3. Explain what an object adapter is. How do we use object adapters?

4. Change the procedure thread_per_object in the example of object adapters in page


157, so that a single thread handles all objects under control of the adapter.

5. A server maintains a TCP/IP connection to a client. Is this server stateful or stateless?

Naming

6. Would you consider a URL such as http://www.acme.org/index.html to be location


independent? What about http://www.acme.nl/index.html? Which one is more location
independent?

7. Give some examples for true identifiers. Examples do not have to be from the electronic
world.

8. Can an identifier contain information on the entity it refers to? If so, what is the condition
on this information?

9. Here is an outline for local generation of globally unique identifiers: Take the network address of
the machine where the identifier is generated; append the local time to that address, along with a
generated pseudo-random number. Can this scheme guarantee the uniqueness of the locally
generated identifiers? How would you improve your scheme?

10. Explain the difference between a hard link and a soft link in UNIX systems.

11. Explain how DNS can be used to implement a home-based approach to locating mobile hosts.

12. Suppose it is known that a specific mobile entity will almost never move outside domain D, and if
it does, it can be expected to return soon. How can this information be used to speed up the lookup
operation in a hierarchical location service?

13. In a hierarchical location service with a depth of k, how many location records need to be updated
at most when a mobile entity changes its location? Note that changing location can be done with

Erkay Savas – CS 403/354


CS 403/534 – Distributed Systems Spring 2003

deletion followed by an insertion operation.

14. Consider an entity moving from location A to B. While moving, the entity also visits several
intermediate locations and stays there only for a very short period of time. When arriving at B, it
settles down for a while. Changing an address in a hierarchical location service usually takes a
relatively long time to complete, and should therefore be avoided when visiting an intermediate
location. How can the entity be located at an intermediate location?

15. Provide arguments about the fact that weighted reference counting is more efficient than
simple reference counting. Assume communication is reliable.

Synchronization

16. 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?

17. Add a new message to Fig. 5-7 in page 254 that is concurrent with message A, that is, it neither
happens before A nor happens after A.

18. Recall that in totally-ordered multicasting with Lamport timestamps, a queued message is
delivered to the application when two conditions hold: (1) the message is at the head of the queue
and (2) has been acknowledged by every other processes. Recall also that each process multicasts
an acknowledgement for each message it received and the communication is FIFI ordered.
To achieve totally-ordered multicasting with Lamport timestamps, is it strictly necessary that each
message is acknowledged? If it is not necessary, how can you replace the second condition for
delivering a message to the application?

19. In Fig. 5-12 on page 265, 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 basic election algorithm.

20. In the centralized approach to mutual exclusion (Fig. 5-13 on page 266), 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 process, which has waited longest in the queue. Give another
possible algorithm for the coordinator to choose the next process.

21. 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?

22. How do the entries in Fig. 5-16 on page 271, change if we assume that the algorithms can be
implemented on a LAN that supports hardware broadcasts?

23. In Fig. 5-25(d) on page 282, 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.

Erkay Savas – CS 403/354


CS 403/534 – Distributed Systems Spring 2003

24. 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.

25. 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?

26. 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?

27. Is optimistic concurrency control more or less restrictive than using time-stamps? Why?

28. Does using timestamping for concurrency control ensure serializability? Discuss.

Consistency and Replication

29. Access to shared Java objects can be serialized by declaring its methods as being synchronized. Is
this enough to guarantee serialization when such an object is replicated?

30. Explain how replication in DNS takes place, and why it actually works so well.

31. Linearizability assumes the existence of a global clock. However, with strict consistency we
showed that such an assumption is not realistic for most distributed systems. Can linearizability be
implemented for physically distributed data stores? Recall that linearizability assumes loosely
synchronized clocks, that is, it assumes that several events may happen within the same time slot.

32. A multiprocessor has a single bus. Is it possible to implement sequential consistent memory?

33. In Fig. 6-8on page 303, is 001110 a legal output for a sequentially consistent memory? Explain
your answer.

34. Consider a personal mailbox for a mobile user, implemented as part of a wide-area distributed
database. What kind of client-centric consistency would be most appropriate?

35. Describe a simple implementation of read-your-writes consistency for displaying Web pages that
have just been updated.

36. When using a lease, is it necessary that the clocks of a client and the server, respectively, are
tightly synchronized?

37. Consider a nonblocking primary-backup protocol used to guarantee sequential consistency in a


distributed data store. Does such a data store always provide read-your-writes consistency?

38. A file is replicated on 10 servers. List all the combinations of read quorum and write quorum that
are permitted by the voting algorithm.

Erkay Savas – CS 403/354

You might also like