1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:07:56 -07:00

doc/go_mem: init-created goroutine behavior changes for Go 1

They can start execution even before all init functions end.

R=rsc, r, adg
CC=golang-dev
https://golang.org/cl/5732061
This commit is contained in:
Shenghou Ma 2012-03-08 03:56:31 +08:00
parent babbf941c9
commit 6b770f05ad

View File

@ -1,6 +1,6 @@
<!--{ <!--{
"Title": "The Go Memory Model", "Title": "The Go Memory Model",
"Subtitle": "Version of June 10, 2011", "Subtitle": "Version of March 6, 2012"
"Path": "/ref/mem" "Path": "/ref/mem"
}--> }-->
@ -107,9 +107,9 @@ unspecified order.
<h3>Initialization</h3> <h3>Initialization</h3>
<p> <p>
Program initialization runs in a single goroutine and Program initialization runs in a single goroutine,
new goroutines created during initialization do not but that goroutine may create other goroutines,
start running until initialization ends. which run concurrently.
</p> </p>
<p class="rule"> <p class="rule">
@ -122,11 +122,6 @@ The start of the function <code>main.main</code> happens after
all <code>init</code> functions have finished. all <code>init</code> functions have finished.
</p> </p>
<p class="rule">
The execution of any goroutines created during <code>init</code>
functions happens after all <code>init</code> functions have finished.
</p>
<h3>Goroutine creation</h3> <h3>Goroutine creation</h3>
<p class="rule"> <p class="rule">