There are a few drawbacks of aiming to use all available CPU time in a PC or mobile game.
System requirements: Even if a game is playable on the PC where you develop your game, it might not be playable on a weaker PC owned by someone who bought your game. Limiting CPU use will keep a game usable on machines that more people are likely to already have. If you really want to see whether you're limiting your market, test your PC games and those of your competitors on a low-end laptop with a Pentium Silver CPU, or test your mobile games on an inexpensive prepaid Android phone.
Power use: A laptop computer drains its battery faster when four cores are used at 100 percent of full frequency than when, say, two cores are used at 60 percent of half frequency. So make sure your controller polling thread, AI thread, physics thread, and graphics thread are blocked until it's time for them to run again. Except in a few very twitchy genres, such as fighting and rhythm, you won't need to poll the controllers faster than about 60 Hz, so set your polling thread to run on a 60 Hz timer.
Physics variability: If physics that affect gameplay are more detailed on stronger machines, the same player action will have different outcomes on different machines. This means the player may be able to cheat by using a stronger or weaker machine. Id's Quake III Arena is notorious for having frame rate affect jump height (as described in "UpsetChaps Quake3 Guide - Why Your Framerate Affects Jumping"). To avoid this, a lot of games use a fixed time step for physics. But this doesn't affect physics that are disconnected from gameplay, such as particle effects or cloth effects or interpolation of coordinates between physics frames to render video at a higher frame rate than physics. So design your physics using some variant of model-view-controller architecture, where essential things (acceleration, hit detection, and the like) go in the model and adjustable eye candy goes in the view.
AI variability: If the AI is more detailed on stronger machines, enemies will behave differently on different machines. For example, in a Go or Chess implementation, the opponent will be weaker on a weaker PC, and players can cheat by playing the game on a weaker PC or by running background processes such as antivirus or video transcoding or operating system updates.
while true do CheckForEvents;
\$\endgroup\$while (true)
). Used 90%+ of one CPU to do so. Added aThread.Sleep(5)
to it brought CPU usage down to under 40%. Going to 25 milliseconds between polls brought it down to under 10%. \$\endgroup\$