Abstract
Have you ever wondered what really lies behind the “go” statement? Did you ever stop and think about differences between goroutines and standard operative system threads? Is there something you should know to avoid bugs or weird, unintended behaviours? What really happens when you spawn a goroutine? How are variables closured in it? How does the scheduler interrupt execution of a goroutine to switch context or perform a garbage collection? Why should you know the answers to all these questions? Goroutines are one of Go’s core features. They are by far more efficient than standard OS threads, but they have to pay a price for that. This talk is about go’s runtime internals and their most unexpected behaviors you should know about.