We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 97e45e7 + 648e31f commit 15d5a63Copy full SHA for 15d5a63
2.7.md
@@ -43,6 +43,7 @@ Goroutines是通过Go的runtime管理的一个线程管理器。Goroutines通过
43
hello
44
45
我们可以看到go关键字很方便的就实现了并发编程。
46
+runtime.Gosched()表示让CPU把时间片让给别人。
47
## channels
48
Goroutines运行在相同的地址空间,因此访问共享内存必须做好同步。那么Goroutines之间如何进行数据的通信呢,Go提供了一个很好的通信机制channel。channel可以与Unix shell 中的双向管道做类比:可以通过它发送或者接收值。这些值只能是特定的类型:channel类型。定义一个channel 时,也需要定义发送到channel 的值的类型。注意,必须使用make 创建channel:
49
0 commit comments