Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


The 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.


I assume every OS thread the go runtime is utilising is looking for an unblocked goroutine to execute and can't find any unblocked ones.


It is in the general case, but most cases are decidable, so it's still a useful feature.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: