summaryrefslogtreecommitdiff
path: root/doc/go_spec.html
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2013-08-01 07:12:32 +1000
committerRob Pike <r@golang.org>2013-08-01 07:12:32 +1000
commitc8d847911813caf4c31e18a84a49e0b3512b56af (patch)
treef10ad84e3c728e859cb8743e4c25353c92c83c67 /doc/go_spec.html
parent940160c45b559b2053e20f545ce05322938807ab (diff)
downloadgo-c8d847911813caf4c31e18a84a49e0b3512b56af.tar.gz
spec: clarify a couple of issues about channels
1. They are FIFOs. 2. They are safe for concurrent access. Fixes issue 5911. R=golang-dev, dvyukov, adg CC=golang-dev https://codereview.appspot.com/11549043
Diffstat (limited to 'doc/go_spec.html')
-rw-r--r--doc/go_spec.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 3f6ea8668..f582231c5 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -4126,6 +4126,20 @@ A send on a closed channel proceeds by causing a <a href="#Run_time_panics">run-
A send on a <code>nil</code> channel blocks forever.
</p>
+<p>
+Channels act as first-in-first-out queues.
+For example, if a single goroutine sends on a channel values
+that are received by a single goroutine, the values are received in the order sent.
+</p>
+
+<p>
+A single channel may be used for send and receive
+operations and calls to the built-in functions
+<a href="#Length_and_capacity"><code>cap</code></a> and
+<a href="#Length_and_capacity"><code>len</code></a>
+by any number of goroutines without further synchronization.
+</p>
+
<pre>
ch &lt;- 3
</pre>