concept deadlock in category go

appears as: deadlock, deadlocks, deadlock
Get Programming with Go

This is an excerpt from Manning's book Get Programming with Go.

When one or more goroutines end up blocked for something that can never happen, it’s called deadlock, and your program will generally crash or hang up. Deadlocks can be caused by something as simple as this:

func main() {
    c := make(chan int)
    <-c
}

In large programs, deadlocks can involve an intricate series of dependencies between goroutines.

Although theoretically hard to guard against, in practice, by sticking to a few simple guidelines (covered soon), it’s not hard to make deadlock-free programs. When you do find a deadlock, Go can show you the state of all the goroutines, so it’s often easy to find out what’s going on.