Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 1.1 What is concurrency.md #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions zh/chapter1-Introduction/1.1 What is concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ Go 是一门新兴的编程语言,Go 官方对其介绍如下:
>
> Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines.

Go 的并行机制使其非常容易编写多核和网络应用。Go 语言的并发模型基于 CSP(Communicating sequential processes, 参见维基百科 [CSP](http://en.wikipedia.org/wiki/Communicating_Sequential_Processes))。Go 提供了 goroutines(并发执行), channels(同步和通信), select(多路并发控制) 等特性来支持并发编程。Go 的发明者之一 Rob Pick 在他的一篇讲稿([Concurrency is not Parallelism(it's better)](http://concur.rspace.googlecode.com/hg/talk/concur.html))中提到:
Go 的并行机制使其非常容易编写多核和网络应用。Go 语言的并发模型基于 CSP(Communicating sequential processes, 参见维基百科 [CSP](http://en.wikipedia.org/wiki/Communicating_Sequential_Processes))。Go 提供了 goroutines(并发执行), channels(同步和通信), select(多路并发控制) 等特性来支持并发编程。Go 的发明者之一 Rob Pick 在他的一篇讲稿([Concurrency is not Parallelism](https://talks.golang.org/2012/waza.slide#1))中提到:

> [Concurrency](http://concur.rspace.googlecode.com/hg/talk/concur.html#slide-3): Programming as the composition of independently executing processes.
> [Concurrency](https://talks.golang.org/2012/waza.slide#6): Programming as the composition of independently executing processes.
>
> [Parallelism](http://concur.rspace.googlecode.com/hg/talk/concur.html#slide-4): Programming as the simultaneous execution of (possibly related) computations.
> [Parallelism](https://talks.golang.org/2012/waza.slide#7): Programming as the simultaneous execution of (possibly related) computations.

Rob 认为并发是程序本身的一种特性,程序被分为多个可独立执行的部分,而各个可独立执行的片段通过通信手段进行协调(后文会提到),而并行则是程序的计算过程(不同的计算过程可能相关联)同时执行。

Rob Pike 的观点是: 并发是一次处理(dealing with)很多事情,而并行是一次做(doing)很多事情.(注: 英文词汇的表达也很微妙)[原文](http://concur.rspace.googlecode.com/hg/talk/concur.html#slide-5)是如下:
Rob Pike 的观点是: 并发是一次处理(dealing with)很多事情,而并行是一次做(doing)很多事情.(注: 英文词汇的表达也很微妙)[原文](https://talks.golang.org/2012/waza.slide#8)是如下:

> Concurrency is about dealing with lots of things at once.
>
Expand All @@ -52,9 +52,9 @@ Rob Pike 的观点是: 并发是一次处理(dealing with)很多事情,而

即我们可以利用并发的手段去构建一种解决方案来解决那些有可能被并行处理的问题。

作者在本文中还[提到](http://concur.rspace.googlecode.com/hg/talk/concur.html#slide-7),设计并发程序时应该将程序分为多个执行片段,使得每个片段可以独立执行。不同执行片段通过通信(Communication )来进行协调。因此 Go 的并发模型基于 CSP: C. A. R. Hoare: Communicating Sequential Processes (CACM 1978)
作者在本文中还[提到](https://talks.golang.org/2012/waza.slide#10),设计并发程序时应该将程序分为多个执行片段,使得每个片段可以独立执行。不同执行片段通过通信(Communication )来进行协调。因此 Go 的并发模型基于 CSP: C. A. R. Hoare: Communicating Sequential Processes (CACM 1978)

作者后面还给出了一个例子来阐述他的观点,感兴趣的读者可以继续阅读:([Concurrency is not Parallelism(it's better)](http://concur.rspace.googlecode.com/hg/talk/concur.html))
作者后面还给出了一个例子来阐述他的观点,感兴趣的读者可以继续阅读:([Concurrency is not Parallelism(it's better)](https://talks.golang.org/2012/waza.slide#11))

### 1.2.3 Haskell 语言中的并发与并行###

Expand Down