Download presentation
Presentation is loading. Please wait.
Published byPamela Mary Sims Modified over 8 years ago
1
CIS 825 Review session
2
P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion algorithm. To make a request, a process sends the request message in the clockwise manner around the ring. When a process receives a request, it enqueues the request in its request queue (which is sorted according to the timestamps) and passes the request to the next node. A process can enter the critical section if it has received its request back (after it has gone around the ring) and its request is at the head of the queue. The release messages are also sent in the clockwise manner. There are no reply messages. Does this algorithm satisfy the properties of mutual exclusion and causal ordering (that is, if request R1 happens before R2 then R1 is served before R2).
3
Consider the problem in which processes need two types of accesses to the critical section: read access and write access. Two or more read accesses can be granted concurrently. However, a write access cannot be granted concurrently with a write or a read access. Modify the Lamport’s mutual exclusion algorithm to solve this problem. When a process wants to read (or write), it will send a read (write) request with the logical timestamp. The requests are queued in the timestamp order in the local queues and must be served in the timestamp order as in Lamport’s algorithm.
4
P2: Assume a network in which it takes at most δ seconds for each message to arrive at their destination and get processed. Consider the following algorithm for termination detection: The coordinator sends a message to all sites to detect termination. On receiving this message, each site sends its state (active or passive) to the coordinator. If the coordinator receives a passive message from all sites, it again sends a message asking “Are you still passive” after waiting for δ secs. On receiving this message, if a site has remained passive since it sent the previous message to the coordinator, it responds with a “yes” message. If the coordinator receives all “yes” responses, it declares termination. Does this algorithm detect termination correctly ? Give reasons for your answer.
5
Describe an algorithm to detect termination of a distribution computation on a rooted tree topology. Assume that in the computation, a node can send application messages to its parent and its children. Furthermore, the root is the initiator of the termination detection algorithm, and the communication model is asynchronous.
6
P3: Develop an algorithm for leader election in a mesh network of size N*N. The algorithm must be as efficient in terms of number of messages. Give the message complexity of your algorithm
7
Consider a network in which all sites have perfectly synchronized clocks (and all clocks tick at the same rate). The following centralized protocol can be used for mutual exclusion: The central site services the request in the order in which they arrive. It allocates each request a time period of duration slot during which the requester can access the resource. For this purpose, the central site maintains a variable, time avail. The actions of the central site on receiving a request are as follows: On receiving reqi from site i: time avail := max(time avail, local clock value); allocate the period [time avail, time avail + slot] to reqi; sends grant(time avail) to i; time avail := time avail + slot When i receives a message grant(t), it assumes that it can access the resource in the time period [t, t + slot] according to its clock. It is assumed that the maximum transmission time is less than slot. (a) Modify the protocol given above for the case in which the clocks are E-synchronized. However, it is still assumed that all clocks tick at the same rate and maximum transmission time is less than slot. Do not introduce release message in the protocol. (b) Discuss the problems that may arise in the solution to (a) if the assumption that the maximum transmission time is less than slot is removed. Modify the solution to remedy as many problems as possible
9
P5: Consider a set of processes arranged in a tree topology. To broadcast a message m, a node sends m to all of its neighbors. Each node, in turn, forwards m on all of its edges (except the one which m is received). Does this algorithm ensure causal ordering; that is, any two broadcast messages m1 and m2 (sent by two different processes), if send(m1) happens before send(m2) then M1 is delivered before m2 to all sites. Given convincing reasons for your answers. Assume that each edges is reliable and FIFO.
10
P6: Assume that you have a ring topology with each edge having a unique weight. Discuss an algorithm to construct a minimum spanning tree for this topology (do not just give the algorithm discussed in the class; if you do, you need to justify why that algorithm is the best one for this case). What is the message complexity of your algorithm? The algorithm must be efficient in terms of number of messages.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.