This commit is contained in:
github-actions[bot]
2025-07-28 04:56:46 +00:00
parent 26da315c57
commit a08e171516
128 changed files with 149 additions and 527 deletions

View File

@@ -528,7 +528,7 @@
<div class="sidetoc"><nav class="pagetoc"></nav></div>
<main>
<ul dir="auto"><li><em>凹语言(Go实现, 面向WASM设计): <a href="https://github.com/wa-lang/wa">https://github.com/wa-lang/wa</a></em></li><li><em>WaBook(Go语言实现的MD电子书构建工具): <a href="https://github.com/wa-lang/wabook">https://github.com/wa-lang/wabook</a></em></li></ul><hr>
<ul dir="auto"><li><em>凹语言(Go实现, 面向WASM设计): <a href="https://github.com/wa-lang/wa">https://github.com/wa-lang/wa</a></em></li><li><em>《Go语言高级编程》: <a href="https://github.com/chai2010/advanced-go-programming-book">https://github.com/chai2010/advanced-go-programming-book</a></em></li></ul><hr>
<h2>8.1. Goroutines</h2>
<p>在Go语言中每一个并发的执行单元叫作一个goroutine。设想这里的一个程序有两个函数一个函数做计算另一个输出结果假设两个函数没有相互之间的调用关系。一个线性的程序会先调用其中的一个函数然后再调用另一个。如果程序中包含多个goroutine对两个函数的调用则可能发生在同一时刻。马上就会看到这样的一个程序。</p>