Election algorithms Flashcards
Define Election algorithms and give an example
Algorithms for choosing a unique process to play a particular role
E.g. choose mutual exclusion central server from among the processes that need to use the critical section
State a key property of an elected process
Choice of elected process must be unique, even if several processes call elections concurrently
The performance of an election algorithm is measured by?
♦ Total network bandwidth utilisation (total messages sent)
♦ Turnaround time – number of serialised message transmission times between initiation and termination of a single run
What type is Chang and Roberts algorithm?
ring-based election
In Chang and Roberts algorithm how are processes arranged?
Processes are arranged in a logical ring
Explain how in Chang and Roberts algorithm processes send messages
Each process p(i) has a communication channel to the next process in the ring, p(i+1)modN.
All messages sent clockwise around the ring.
What is the goal of Chang and Roberts algorithm?
to elect the coordinator, the process with the largest identifier
In Chang and Roberts algorithm how are elections initiated?
Any process can initiate an election
♦ Marks itself as a participant
♦ Places its identifier in an election message
♦ Sends the message to its clockwise neighbour
What happens in Chang and Roberts algorithm when a process p[k] receives an election message with enclosed ID p[i]?
♦ If p[k] non-participant, forward max(p[i], p[k]); mark itself as participant
♦ If p[k] participant, forward p[i]only if p[i]> p[k] otherwise do nothing
What happens in Chang and Roberts algorithm when a process p[k] receives an election message and (p[i]== p[k])?
♦ p[k] becomes coordinator
♦ Mark itself non-participant; send elected message with its ID to neighbour
What happens in Chang and Roberts algorithm when a process p[k] receives an elected message with enclosed ID p[i]?
♦ Mark itself as non-participant
♦ Set elected[k] = p[i]
♦ If (p[k] != coordinator)
{Forward message to neighbour}
Performance of ring-based election algorithm - state how E1 is met (2 points)
♦ All identifiers are compared; a process must receive its own identifier back before sending an elected message
♦ For any two processes, the one with the larger
identifier will not pass on the other’s identifier =>
impossible that both should receive their own identifiers back
Performance of ring-based election algorithm - state how E2 is met (
E2 follows immediately from the guaranteed traversals of the ring (no failures)
♦ non-participant and participant states used so that messages arising when another process starts a
concurrent election are extinguished as soon as
possible, before the winning election result has been
announced
Give the worst case performance of ring-based election algorithm If only a single process starts an election.
Worst case is when anti-clockwise neighbour has the highest identifier
In the worst case performance of ring-based election algorithm how many messages are required to reach the winner?
N-1 messages are needed to reach this neighbour