Tuesday, May 14, 2024
HomeGolangRuntime: goroutine blocks endlessly - Getting Assist

Runtime: goroutine blocks endlessly – Getting Assist


Hiya all,
I’ve this little bit of Golang code right here

After I run this, it blocks endlessly and my assumption is as a result of habits of time.Tick which probably ends in a leak and the vary over a channel which blocks so long as there’s a chance of a write into the channel.

I wish to get assistance on readability as as to whether or not my understanding of this case is appropriate.

I feel your final for loop is ready for the channel to shut. And your goroutine is obstructing ready for brand spanking new knowledge on the channel that by no means arrives.

Thanks on your response @mje
On the a part of the blocking goroutine. I perceive that the routine can be blocked inside its personal self however is that this presupposed to have an effect on the principle routine?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments