并发程序、并行程序和分布式程序的区别
我刚刚进行编程结构研究;特别是我正在研究并发程序。我读过几篇文章,其中并发程序、并行程序和分布式程序之间的区别似乎令人困惑。
我的理解如下:
并发程序:同时执行多个任务或给出这样做的概念
并行程序:解决此类问题的算法允许同时执行一些相关任务
分布式程序:更多地与可用资源多于相应算法中固有的并行性。不止一种计算资源可用于解决该问题。
有人可以指出我对这些术语的正确和详细的解释吗?
I was just going through programming structure studies; In particular I was studying concurrent programs. I came across few articles where distinction between concurrent programs, parallel programs and distributed programs seems confounding.
My understanding is as follows:
concurrent programs : performs several tasks at the same time or gives a notion of doing so
parallel programs : algorithms for solving such problems allow some related tasks to be executed at the same time
distributed programs: Has more to do with available resources than inherent parallelism in the corresponding algorithm. More than one computing resource is available to solve the problem.
Could someone please point me to correct and detailed explanation of these terms?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些术语确实相关,有时甚至重叠:
并行编程是并发编程的一个子集,旨在使用多个并发执行的实体(线程、进程)来加速某些计算。
分布式计算是一个非常广泛的主题,正如您所说,它侧重于使用资源来解决问题。这些资源可以位于同一台机器上,也可以在地理上分散或异构。并行计算和分布式计算之间很难划清界限。并行计算可能是分布式的,也可能不是分布式的,具体取决于所使用的资源,而分布式计算可能会或可能不会用于并行解决问题。
在我看来,这些术语之间的微妙区别来自于考虑它们的抽象层。当主要焦点是单独的计算实体在某些共享数据上的交互时,我们就讨论并发编程。当关键方面是通过使用多个计算单元来加速计算时,我们就有了并行计算。最后,如果重点是管理资源来解决某些问题的方式,那么我们正在谈论分布式计算。
These terms are indeed related and sometimes overlapping:
Parallel programming is a subset of concurrent programming that aims to use several concurrently executing entities (threads, processes) in order to speedup some computation.
Distributed computing is a very wide topic that, as you said, focuses on using resources to solve a problem. These resources can be on the same machine, or can be geographically dispersed or heterogeneous. It is hard to draw a clear line between parallel and distributed computing. Parallel computing may or may not be distributed, depending on the resources used, while distributed computing may or may not be used to solve a problem in parallel.
In my opinion, the subtle distinction between these terms comes from the abstraction layers at which they are considered. When the main focus is the interaction of separate computational entities over some shared data, then we talk about concurrent programming. When the key aspect is speeding up a computation by using several computational units, we have parallel computing. Finally, if the focus is on the way resources are managed to solve some problem, then we are talking about distributed computing.