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

Infinite loops are not that harmful by themselves if they only spin the CPU. The scheduler can schedule other work on the core if the process' timeslice runs out, or it results in a frozen application if said infinite loop happens on an event loop thread.

Neither are pleasant, but they don't compromise system integrity and as such are not substantially different from other kinds of crash bugs.



> Infinite loops are not that harmful by themselves if they only spin the CPU

Categorically that's the exception, not the norm.

For always-on systems, "by themselves" is pretty critical, as they can result in DOS style bugs/attacks as illustrated in the parent article. The infinite loop is most useful e.g. for the scheduler or other event loop code, which by definition this style of code does a lot more than "only" spin the CPU.

For systems capable of long-term power saving operation - the system can go dormant (either no power draw or very little). An infinite loop can be the difference between weeks of power off a battery, or days/hours.




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

Search: