简体   繁体   English

功能并发

[英]functional concurrency

when there is some list of advantages of functional languages, there is usually mentioned that it makes concurrency easier because there is not any variables which are subject of change. 当有一些功能语言的优点列表时,通常会提到它使并发变得更容易,因为没有任何变量可以更改。 But, as my assembler-school-lessons-memory knows, there are registers in cpu and memory, that are both mutable. 但是,正如我的汇编学校课程内存所知道的那样,cpu和内存中的寄存器都是可变的。 So when the high-level functional code is compiled into some low-lever code, it becomes imperative and mutable. 因此,当将高级功能代码编译为一些低杠杆代码时,它变得势在必行且易变。 So I'm not understanding what is the advantage of using functional languages in concurrency. 因此,我不了解并发使用功能语言的优势。 Can anyone explain this? 谁能解释一下?

It's programmers, not computers, that have a hard time with concurrency. 很难并发的是程序员而不是计算机。 So saying that immutability makes it easier means on humans, not on computers. 因此说不变性使它变得更容易,意味着对人类而不是计算机。

(I include compiler writing as a human activity) (我将编译器编写作为人类活动进行了介绍)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM