Efficient Consensus And Synchronization For Distributed Systems