Skip to content

Always uses 100% of a CPU core

The main game loop never sleeps. It loops continuously, busy waiting until it's time to update and/or render. There is a Thread.yield(), but it doesn't seem to make any difference. The docs for Thread.yield() say not to rely on it, and in fact recommend against using it. Sleeping in the main thread seems to have been present in the initial version before being added and removed multiple times, but as it currently stands there is no sleep.

I don't understand that OpenGL bug well enough to comment on that, but maybe we can bring back the sleep in a way that will avoid that problem?

That's not to say that Thread.sleep() is the best way to handle the problem. I brought in the context of past changes to the game loop to avoid history repeating itself.