函数式编程和多核架构 [英] Functional programming and multicore architecture
问题描述
我在某处读到函数式编程适合利用计算中的多核趋势.我没有真正明白这个想法.和 lambda 演算和冯诺依曼架构有关系吗?
I've read somewhere that functional programming is suitable to take advantage of multi-core trend in computing. I didn't really get the idea. Is it related to the lambda calculus and von neumann architecture?
推荐答案
函数式编程可以最小化或消除副作用,因此更适合分布式编程.即多核处理.
Functional programming minimizes or eliminates side effects and thus is better suited to distributed programming. i.e. multicore processing.
换句话说,可以在不同的内核上同时独立解决许多难题,而不必像在其他编程风格中一样担心一个操作对另一个操作的影响.
In other words, lots of pieces of the puzzle can be solved independently on separate cores simultaneously without having to worry about one operation affecting another nearly as much as you would in other programming styles.
这篇关于函数式编程和多核架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!