说实话在翻译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的同义词。