Go: What Does a Goroutine Switch Actually Involve?
ℹ️ This article is based on Go 1.13.
Goroutines are light; they just need a memory stack of 2Kb to run. They are also cheap to run; switching a goroutine to another one does not require many operations. Before jumping into the switch itself, let’s review how the switch works at a higher level.