Professional Documents
Culture Documents
Souf Iane
Souf Iane
Bully Algorithm
Présenter par:
Ms:bouhafs daoui
MS: khlef abdelkrim
MS: Fattah soufiane
Operating Systems play a critical role in managing
and coordinating the activities of a computer
system. In distributed systems, where multiple
computers work together to achieve a common goal,
the issue of node/process failure becomes a
significant concern. To ensure the reliability and fault
tolerance of a distributed system, leader election
algorithms come to the rescue. In this article, we will
discuss the leader election algorithm (Bully
algorithm) and understand how it guarantees the
election of a new coordinator when the current
coordinator fails
Leader Understanding Election Algorithm:
The election algorithm is based on the following assumptions:
6
Steps Involved in Bully Algorithm
Step 1: Suppose Process P2 sends a message to coordinator P5 and P5 doesn’t
respond in a desired time t ( possible reason could be crash ; down
Step 2: Then process P2 , sends an election message to all processes with Process ID greater
than P2 (i.e. P3, P4 & P5) and awaits a response from the processes
Step 3: If no one responds, P2 wins the election and become the coordinator.
Step 4: If any of the processes with Process ID higher than 2 responds
with OK, P2’s job is done and
this Process will take over.
Step 5: It then restarts and initiates an election
message
Step 6: Process P4 responds to P3 with an OK message to confirm its alive state and Process
P4 figures out that process 5
has crashed, and the new process with the highest ID is process 4.
Step 7: The process that receives an election message sends a coordinator message if
it is the Process with
the highest ID (in this case it is P4).
Whether you're preparing for your first job interview or aiming to up skill
in this e
ver.-evolving tech landscape, GeeksforGeeks Courses are your key to success.
We provide
top-quality content at affordable prices, all geared towards accelerating your
growth in a time-bound manner.
Join the millions we've already empowered, and we're here to do
the same for you. D'ont miss out
The algorithme
The algorithme assumes That each processus has a Unique Iden
(UID) and That the processus Can arrange the selves in a
unidirectional ring with a communication Channel coing from e
process to the clockwise neighbour. The two part algorithme ca
described as follows:
1.Initially each process in the ring is marked as non-participant.
3-When the elected message reaches the newly elected leader, the leader
discards That message, and the élection is over.