# Parallelism Vs Concurrency

2019/01/06 18:13

Haskell 在wiki里对这两者有过一篇文章, 里面给出了解释:The term Parallelism refers to techniques to make programs faster by performing several computations at the same time. The term Concurrency refers to techniques that make programs more usable. 并行是为了提升计算速度的技术，而并发是为了使程序更合用。If you run distributed-net computations in the background while working with interactive applications in the foreground, that is concurrency. On the other hand, dividing a task into packets that can be computed via distributed-net clients is parallelism.. Go 的发明者 Rob Pike 曾对这个做过一个 presentation Concurrency is not parallelism, 他将 concurrency 当做指导我们编程的准则，也就是他说的Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once. 我们需要将任务一步步分解开来，在脑海中描绘完成任务所需的步骤，每一步可以是独立的也可以依赖其他的步骤。当我们将任务步骤完成后，这个整体可以拷贝复制很多份并行执行。

0
0 收藏

0 评论
0 收藏
0