Google News
logo
Golang - Interview Questions
What is a Goroutine and how do you stop it?
A Goroutine is a function or procedure that runs concurrently with other Goroutines on a dedicated Goroutine thread. Goroutine threads are lighter than ordinary threads, and most Golang programs use thousands of goroutines at the same time. A Goroutine can be stopped by passing it a signal channel. Because Goroutines can only respond to signals if they are taught to check, you must put checks at logical places, such as at the top of your for a loop.
Advertisement