diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
commit | 519725bb3c075ee2462c929f5997cb068e18466a (patch) | |
tree | 5b162e8488ad147a645048c073577821b4a2bee9 /doc/go_mem.html | |
parent | 842623c5dd2819d980ca9c58048d6bc6ed82475f (diff) | |
download | golang-upstream-weekly/2012.03.22.tar.gz |
Imported Upstream version 2012.03.22upstream-weekly/2012.03.22
Diffstat (limited to 'doc/go_mem.html')
-rw-r--r-- | doc/go_mem.html | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/doc/go_mem.html b/doc/go_mem.html index a00324158..ece230638 100644 --- a/doc/go_mem.html +++ b/doc/go_mem.html @@ -1,6 +1,6 @@ <!--{ "Title": "The Go Memory Model", - "Subtitle": "Version of June 10, 2011", + "Subtitle": "Version of March 6, 2012", "Path": "/ref/mem" }--> @@ -107,9 +107,9 @@ unspecified order. <h3>Initialization</h3> <p> -Program initialization runs in a single goroutine and -new goroutines created during initialization do not -start running until initialization ends. +Program initialization runs in a single goroutine, +but that goroutine may create other goroutines, +which run concurrently. </p> <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. </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> <p class="rule"> @@ -288,7 +283,7 @@ The <code>sync</code> package implements two lock data types, <p class="rule"> For any <code>sync.Mutex</code> or <code>sync.RWMutex</code> variable <code>l</code> and <i>n</i> < <i>m</i>, -the <i>n</i>'th call to <code>l.Unlock()</code> happens before the <i>m</i>'th call to <code>l.Lock()</code> returns. +call <i>n</i> of <code>l.Unlock()</code> happens before call <i>m</i> of <code>l.Lock()</code> returns. </p> <p> @@ -321,9 +316,9 @@ which happens before the <code>print</code>. <p class="rule"> For any call to <code>l.RLock</code> on a <code>sync.RWMutex</code> variable <code>l</code>, -there is an <i>n</i> such that the <code>l.RLock</code> happens (returns) after the <i>n</i>'th call to +there is an <i>n</i> such that the <code>l.RLock</code> happens (returns) after call <i>n</i> to <code>l.Unlock</code> and the matching <code>l.RUnlock</code> happens -before the <i>n</i>+1'th call to <code>l.Lock</code>. +before call <i>n</i>+1 to <code>l.Lock</code>. </p> <h3>Once</h3> |