Welcome
davidhagg / bullysharp Goto Github PK
View Code? Open in Web Editor NEWA C# implementation of the Bully leader election algorithm
License: MIT License
A C# implementation of the Bully leader election algorithm
License: MIT License
Could it be that you missed the step
If P receives an Election message from another process with a lower ID it sends an Answer message back and starts the election process at the beginning, by sending an Election message to higher-numbered processes.
in your implementation? I was wondering why at times when process 0 was going through the election and then elected a leader, and at the same time I was starting up process 1, process 1 might get a victory message from 0 and thus declare the leader is 0. And then both would go on pinging each other and merrily keep that state.
Your MessageListener
doesn't have the capability to determine the process id of the sender of an election, and there's nothing in there retriggering an election should an election message be received from a peer with a lower Id.
Also, I was wondering, what's the reason for the 2 second delay between starting the MessageListener
and the LeaderElection
- is that a safety buffer to work around the problem I mentioned above ?
I went ahead and implemented that missing step. Plus I was occasionally getting the wrong leader when the process with the lower id was in the middle of the election when the process with the higher id started. So as a safety, when I get an election from a lower process, I retrigger the election which corrects the state.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.