崩溃共识算法

时间:2012-05-16 09:57:08

标签: java algorithm pseudocode

我在实施崩溃共识算法时遇到问题。 这是一些伪代码。有人可以给我一个关于它意味着什么的解释。

Crash-Consensus-Receive-Message(m)
if m is proposal message then
    ▷add the received values to set of all known proposed values
    add[knownValues,values[m]]
    note that sender[m]has not crashed during this round
else                ▷ordinary message received
process message m

Crash-Consensus-Reach-Consensus()
knownValues←{ownValue}  ▷start with just own proposed value
sentValues←0            ▷no values sent yet
for i←0 to f do         ▷f+1 rounds of multicasts
      ▷determine which known values have not yet been sent
      newValues←knownValues -ssentValues
      multicast proposal message with newValues to alive processes
      wait until next round
use pre-agreed strategy with knownValues to get consensus value 

发件人[m]和值[m]是什么意思,因为m表示消息?另外,knownValues是什么意思。

1 个答案:

答案 0 :(得分:0)

在大多数编程语言中,方括号表示一个值数组,在您的情况下是一组已知消息或要发送的消息数组。我不确定伪代码中是否也是如此,但我认为也许可以帮助你。