Commit 9f48f7e6 authored by Russ Cox's avatar Russ Cox

ucsd cns talk, focused on networking

R=r
CC=golang-dev
https://golang.org/cl/186230
parent 2ce13ba4
......@@ -255,15 +255,15 @@ func main() {
<h2>Use explicit messages to communicate and synchronize.</h2>
<pre>
func computeAndSend(c chan int, x, y, z int) {
c <- expensiveComputation(x, y, z)
func computeAndSend(ch chan int, x, y, z int) {
ch <- expensiveComputation(x, y, z)
}
func main() {
c := make(chan int)
go computeAndSend(c, x, y, z)
ch := make(chan int)
go computeAndSend(ch, x, y, z)
v2 := anotherExpensiveComputation(a, b, c)
v1 := <-c
v1 := <-ch
fmt.Println(v1, v2)
}
</pre>
......
This diff is collapsed.
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