Tools to detect starvation & livelocks?

Hi all,

What tools do you use to detect starvation & livelocks ? Do you have a strategy for debugging this ?

Hi @telo_tade,

Starvation is a situation where a group of goroutines access a pool of limited resources, and one or more of the goroutines never get hold of one of these resources because other goroutines always come first. Or they do get hold of the resources rarely but not as much as the other goroutines.

To detect this situation, the goroutines would need to write log or tracing information about their activities. A monitoring tool could then reveal if some of the competing goroutines are inactive, or almost inactive, while other goroutines of the same group are fairly busy.

Since totally equal distribution of work is perhaps never achieved, you’d need to watch the stats over a longer period of activity, to see if work is continuously distributed in an uneven way between the goroutines.

Regarding livelocks, just recently I did intensive research to find useful working examples of livelocks in real systems.

I found none.

Really, I found no practical livelock examples. The only “example” that always pops up in the search results is the “two people try to pass each other in a hallway” problem.

I thus came to the conclusion that livelocks are a problem of academic interest only. (I would honestly appreciate if anyone could share a real-world livelock problem here.)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.