6 ms·
How does the runtime detect this? I'd have suspected that such a thing would be undecidable, but I'm not at all a concurrency expert.
by kibwen 14y ago
How does the runtime detect this? I'd have suspected that such a thing would be undecidable, but I'm not at all a concurrency expert.
- jamesmiller5 14y agoThe run-time checks if all goroutines are asleep and waiting for input. If true it panics and halts the program. It can't detect live-lock or thrashing, if you are still waking up other goroutines but not doing anything useful it won't prevent that.
- Djehngo 14y agoI assume every OS thread the go runtime is utilising is looking for an unblocked goroutine to execute and can't find any unblocked ones.
- lucian1900 14y agoIt is in the general case, but most cases are decidable, so it's still a useful feature.