HackerTube

Google I/O 2012 - Go Concurrency Patterns

Google for Developers9 HN recommenders · recommended in 9 months, 2012–2025
YouTube
talk · intermediate · evergreen · 2012–2025 on HN

Rob Pike's Google I/O 2012 talk shows how goroutines and channels solve tricky concurrency problems with simple Go code. It features a playful goroutine demo with gophers passing messages and a search engine example.

The canonical recommendation for learning Go concurrency, praised as entertaining and clarifying when to use channels versus mutexes.

12 comments from Hacker News

@canthonytucci2013-09 · in “Less is exponentially more (2012)”

For those who don't know who Rob Pike is, he's pretty awesome, helped create UTF-8 among other things, and now works on Go. link He has given some really great Go talks which are available on youtube, about an hour each: Origins of Go Concurrency Style - link Lexical Scanning in Go - link Go Concurrency Patterns (One of my favorites) - ▶ this video

Strongly recommends View on HN
@mseepgood2012-07 · in “Having a Go - first time experience with Golang”

Great talk by Rob Pike: ▶ this video "Go Concurrency Patterns" with cute little gophers playing Chinese whispers with megaphones

Strongly recommends View on HN
@pbohun2025-11 · in “A million ways to die from a data race in Go”

Not quite. Erlang uses the Actor model which delivers messages asynchronously to named processes. In Go, messages are passed between goroutines via channels, which provide a synchronization mechanism (when un-buffered). The ability to synchronize allow one to setup a "rhythm" to computation that the Actor model is explicitly not designed to do. Also, note that a process must know its consumer in the Actor model, but goroutines do not need to know their consumer in the CSP model. Channels can even be passed around to other goroutines! Each have their own pros and cons. You can see some of the legends who invented different methods of concurrency here: link There's also a nice talk Rob Pike gave that illustrated some very useful concurrency patterns that can be built using the CSP model: ▶ this video

Recommends View on HN
@gunapologist992022-06 · in “What's New in Python 3.11?”

This is true, that's exactly what exceptions are. One could argue (I would) that this is a very powerful part of Python, but the indeterminate nature of the exception (where is it coming from, how is it defined, what should I provide to my client) makes it easier to catch exceptions as they percolate upward, but more difficult to correctly know how to handle them (especially as the permutations approach infinity as underlying libraries get upgraded). Golang actually has a back-channel communication path that is somewhat similar as a second channel of communications. (Actually they're called channels!) They're a first-class and extremely powerful feature of the language. You can even run a for loop over them, block or not block while waiting for an incoming message, etc. Here's a great video that talks about use cases and the patterns in using them, and they pair great with goroutines (and you don't have to sprinkle async before every function, either): ▶ this video

Recommends View on HN
@staunch2018-08 · in “Ask HN: Concurrency in Go vs. C/C++”

Rob Pike did a number of interesting talks on concurrency in Go. If you search "Go concurrency" on YouTube there are more good talks. Go Concurrency Patterns ▶ this video Concurrency Is Not Parallelism link

Recommends View on HN