Commit bd65404e authored by Rob Pike's avatar Rob Pike

spec: clarify a couple of issues about channels

1. They are FIFOs.
2. They are safe for concurrent access.

Fixes #5911.

R=golang-dev, dvyukov, adg
CC=golang-dev
https://golang.org/cl/11549043
parent fbcc24bb
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment