Xiao Peng

My personal blog moves to xiaopeng.me , blogs about design patterns will be synced to here.
肖鹏,ThoughtWorks资深咨询师,目前关注于架构模式、敏捷软件开发等领域,并致力于软件开发最佳实践的推广和应用。
多次为国内大型企业敏捷组织转型提供咨询和培训服务,在大型团队持续集成方面具有丰富的经验。
  博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

并发(Concurrency)与并行(Parallelism)

Posted on 2009-01-30 22:50  勇敢的鸵鸟  阅读(1248)  评论(0编辑  收藏  举报

说实话在翻译POSA的时候,我不想用这两个词:并发、并行,而宁愿保留原文。但是对于一本讲分布式计算的书,如果我如此固执,里面会多出大量的英文——虽然现在已经是很多了。实际上,我在译文中也做了灵活的处理。比如,“client and server run concurrently”就译成了“客户端和服务器并行运行”。Concurrency译成并发容易给人“同时启动”的印象。至于二者的区别可以参考Sun的定义:

The Sun’s Multithreaded Programming Guide [5] provides good definitions. Parallelism is a condition that arises when at least two threads are executing simultaneously, while concurrency is a condition that exists when at least two threads are making progress.

要有两个线程正在执行才能算是Parallelism;Concurrency则只要有两个以上线程还在执行过程中即可。简单地说,Parallelism要在多核或者多处理器情况下才能做到,而Concurrency则不需要。

下面给出几个链接供参考:

http://blogs.sun.com/yuanlin/entry/concurrency_vs_parallelism_concurrent_programming 【推荐】

http://blogs.sun.com/yuanlin/entry/more_on_concurrency_vs_parallelism

http://www.danielmoth.com/Blog/2008/11/threadingconcurrency-vs-parallelism.html

说完了Concurrency和Parallelism,不得不提一下simultaneous。后者的技术味道并不如前两个那么浓,大体上可以认为是Concurrency的同义词。