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 9b2cdb6 + ed8cae7 commit 7fe72e8Copy full SHA for 7fe72e8
ebook/02.7.md
@@ -31,16 +31,16 @@ goroutine是通过Go的runtime管理的一个线程管理器。goroutine通过`g
31
say("hello") //当前Goroutines执行
32
}
33
34
- 输出:
35
- hello
36
- world
37
38
39
40
41
42
43
+ // 以上程序执行后将输出:
+ // hello
+ // world
44
45
我们可以看到go关键字很方便的就实现了并发编程。
46
上面的多个goroutine运行在同一个进程里面,共享内存数据,不过设计上我们要遵循:不要通过共享来通信,而要通过通信来共享。
0 commit comments