logoalt Hacker News

bitbashertoday at 5:50 PM2 repliesview on HN

If an infinite loop can be both:

1. An infinite busy loop.

2. A thread yield/sleep.

It is by definition undefined behavior. You don't know what you're going to get!


Replies

mwkaufmatoday at 8:06 PM

If it's one of those two it's not fully undefined behavior it's just implementation defined. UB can do anything.

cppcppcpptoday at 6:28 PM

You know what you’re getting, the code is right there!