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

> It's an infinite loop ...

In Go, if runtime.GOMAXPROCS() returns 1 or is set to 1 (meaning, Go only has access to a single system thread), the 'for' loop canabalizes the scheduler and the goroutine is rarely or never scheduled.

That fact doesn't make the OP's statement true, or have anything to do with the optimization bug, but it is worth pointing out that there are situations where Go correctly cannot guarantee that goroutine is executed.



Yes, I am aware of that. Just addressing the OP's misread of the code.

But do note that /may/ change given the GC considerations:

https://github.com/golang/go/issues/10958




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: