Pag 140-144

Election Algorithms

<aside> 💡 Election Algorithms

Untitled

Bully Algorithm

<aside> 💡 When a process $P$ detects the coordinator is no longer responding to requests it hold an election as follows

  1. $P$ sends an ELECTION message to all processes with higher numbers (every process has a unique process number)
  2. If no one responds, $P$ wins the election and becomes coordinator
  3. If one of the higher-ups answers, it takes over. $P$’s job is done
  4. Each higher-ups process sends ELECTION message to all processes with higher numbers until one of them wins.
  5. The winner announces it’s the coordinator by sending a COORDINATOR message to all running processes.

Untitled

In case the original coordinator comes back, it hold an election. It’s called bully algorithm because the process with the highest process number always wins.

</aside>

Untitled

Untitled

Untitled

Ring Algorithm

<aside> 💡 Ring algorithm

Untitled

</aside>

Untitled

Untitled