Go · Concepts
Go goroutine leaks and pprofchannels, mutexes, and exit paths
Starting a goroutine is easy. The hard part was deciding who changes the data, who finishes the work, and when a function may return.
Tag
Starting a goroutine is easy. The hard part was deciding who changes the data, who finishes the work, and when a function may return.
Put go in front of a call and it runs concurrently. So do 100,000 goroutines mean 100,000 threads? Does GOMAXPROCS=1 mean one task at a time?
I was already taking ctx as the first argument and passing it along. What I had never checked was whether canceling actually stops the goroutine. After stalling on that question in an interview, I went back to context from the start.