gpt4 book ai didi

model - 卡恩过程网络和参与者模型之间的区别

转载 作者:行者123 更新时间:2023-12-04 12:35:35 25 4
gpt4 key购买 nike

我想知道 Kahn Process Network 和 Actor Model 之间的实际区别是什么。事实上,如果我查看定义,它们都是计算实体(在这两种情况下都称为 Actors...)通过无界缓冲区交换消息的模型。此外,在这两种情况下,这些消息都是异步发送的,因为过程总是可以发送消息。它不需要等待收件人准备好接收。

因此我的问题是,有什么实际区别吗?

非常感谢 !

最佳答案

卡恩过程网络保证是确定性的。进程之间的所有 FIFO 连接都是事先知道的,并且它们在执行过程中不会动态更改。相比之下,在 Actor 模型的情况下(引用维基百科):

in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received.


Actor 模型,因此不能保证是确定性的。引用维基百科:

The Actor Model features unbounded nondeterminism which was captured in a mathematical model by Will Clinger using domain theory.


另一个重要的区别是通信是如何发生的
在 KPN 的情况下 - 为了保持确定性,所有通信都通过 FIFO channel 。但是在Actor模型的情况下没有这样的要求。引用维基百科:

[In KPN there is] No requirement on order of message arrival [....] If output message ordering is desired, then it can be modeled by a queue Actor that provides this functionality. Such a queue Actor would queue the messages that arrived so that they could be retrieved in FIFO order. So if an Actor X sent a message M1 to an Actor Y, and later X sent another message M2 to Y, there is no requirement that M1 arrives at Y before M2.

In this respect the Actor model mirrors packet switching systems which do not guarantee that packets must be received in the order sent. Not providing the order of delivery guarantee allows packet switching to buffer packets, use multiple paths to send packets, resend damaged packets, and to provide other optimizations.


从上面的讨论中可以很清楚地看出,KPN 是一个更受约束的场景,可以通过添加额外的限制使用 actor 模型进行建模。

关于model - 卡恩过程网络和参与者模型之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9683043/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com