I assume you are familiar with the two general's problem. I came here after watching Tom Scott's video about it. Feel free to correct me if I'm wrong.
Both generals are aware of the strategy they will be using, because in a real world scenario where the generals are the client and the server, the developer creates both.
So, as far as I know, the two general's problem is all about sending acknowledgements to acknowledgements without knowing when to stop, because the one general may not receive the last acknowledgement and won't send his army, because he doesn't know if the other general received the previous one. so instead of stopping, the generals can say that if they manage to maintain an acknowledgement sending rate of approximately one acknowledgement per second for the hour that is one hour before the attack time. I say approximately because if the last acknowledgement is not recieved and the rate is 1 acknowledgement 1.000277778, the generals should still attack. How approximately ? approximately enough for the last acknowledgement to be allowed not to happen, but not enough for the last two to be allowed not to happen. So about a 1 / 3600 seconds tolerance.
What do you all think ? Do you see some case where this solution could fail ? (Not that it should be implemented in a real life scenario)
edit : I tried to reply to a comment, but reddit told me to try again, so I did, but then two comments appeared at once. its the case where the client sends a message to the server, but doesnt recieve the acknowledgement of the server. How funny is that !
No comments:
Post a Comment