英文:
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编程语言的设计中具有很高的影响力,并且还影响了Limbo、RaftLib、Go和Crystal等编程语言的设计。
请注意,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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论