Grokking Concurrency in Go
Vote

0% completed

​

The Or Done Channel

The program prints two events, and then the runtime stops it:

event 1 event 2 fatal error: all goroutines are asleep - deadlock! goroutine 1 [chan receive]: main.main()

The context expired after 50 ms, but the loop never checks it. A for range loop over a channel ends only when the channel is closed, and the code that owns this channel has no reason to close it. The runtime reported the problem here only because every goroutine in the program was blocked and no timer was still pending, which is also why the report came after the 50 ms timeout

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content