Thanks to Gemini, I finally realized what the problem was: Sometimes, one or more Philosopher goroutines attempted to read from the permission channel before it was created by the Host goroutine. Since the value of the channel variable was still nil
, they were getting stuck forever. All I had to do was create the channel in the main goroutine before starting the other goroutines.