其他语言中的Goroutine类似物

huangapple go评论75阅读模式
英文:

Goroutine analogues in other languages

问题

并发编程确实是编程中非常困难的一部分。最近,goroutine非常受欢迎。我的问题是:其他编程语言中存在哪些类似于goroutine的并发机制?

英文:

Concurrency is really hard part of programming. Recent time goroutine is very popular. My question is - What kind of goroutine analogues exist in other languages?

答案1

得分: 10

goroutine受到CSP(通信顺序进程)的启发,在occam编程语言的设计中具有很高的影响力,并且还影响了LimboRaftLibGoCrystal等编程语言的设计。

请注意,goroutine并非没有批评

它与Actor模型的不同之处在于:

  • CSP进程是匿名的,而actor具有身份。

  • CSP的消息传递基本上涉及发送和接收消息的进程之间的会合。相比之下,actor系统中的消息传递基本上是异步的。

  • CSP使用显式通道进行消息传递,而actor系统将消息传递给具有命名目标的actor。

英文:

goroutine are inspired by CSP (Communicating sequential processes), which is highly influential in the design of the occam programming language, and also influenced the design of programming languages such as Limbo, RaftLib, Go, and Crystal.

Note that goroutine are not without criticisms.

It differs from the Actor Model in that:

  • CSP processes are anonymous, while actors have identities.

  • CSP message-passing fundamentally involves a rendezvous between the processes involved in sending and receiving the message. In contrast, message-passing in actor systems is fundamentally asynchronous

  • CSP uses explicit channels for message passing, whereas actor systems transmit messages to named destination actors.

huangapple
  • 本文由 发表于 2016年12月23日 13:14:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/41295538.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定