Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
CS131 Parallel and Distributed Systems
Homework 1
CS131, Spr. 2024
1. Clocks (10pts)
a) A unidirectional logical ring consists of 4 nodes with IDs 1 through 4. Node I is connected to node (I+1) mod 4. Initial LC values at each node are I mod 2. A token is sent from node 1 (to 2) and circulates around the ring reaching back to 1. What are the logical clock values in nodes at this time? (5pts)
b) The diagram below shows 3 processes exchanging messages (initially all local clocks are zero). Show vector clock values at each event in the diagram. (5pts)
2. Elections (10pts)
There are N processes in the system and the status of a node can change dynamically from on to off and off to on. Node IDs are 1 to N. A node initiates an election when it detects the coordinator down or when its status changes from off to on. A broadcast mechanism is available in the system. Assume that a message can be acknowledged with either ACK or NACK between two nodes, including the broadcast. Implement an election algorithm for this system using the broadcast.
2. Mutual exclusion (10pts)
Show the distributed mutual exclusion algorithm for the example in Fig. 6.16 using vector clocks. Show a complete list of messages sent and received by each process and the content of each message. Use the times of initial messages as Vi[i].
P0
P1
P2