near the end of the log will be a line like:
0:01:29.46,1,GUI_EXIT,"Idle loop average: 44916 loops/sec"
Some explanation of what I am looking at here...
Ordinarily, Windows sends a message to an application that a key has been pressed or the mouse has moved, etc. These mssages stack up in a queue so the app can process them asynchronously as needed. DWJukebox, however, ignores this and looks at the actual state of the hardware as it passes through its idle loop. Naturally, there is a risk of missing an event, but theoretically this idle loop should happen so often that this synchronous operation should not be a problem. In the case of my development machine, you can see that 44,916 idle loops are processed on average every second. Theoretically, to miss a keystroke or button press, a key would have to be pressed and released in less than 1/45,000th of a second. The human finger is just not capable of moving this fast. At CPUUsage=100, I get 202,521 loops/sec, so my chances of missing a keystroke or mouse button press
should be non-existent.
Now in reality, this rate is not constant. When a page change is in progress or the sound buffer is being refilled, the idle loop doesn't run. There are limiters in place, however, that are supposed to keep these types of events from interfering with reading input. The juke runs an internal clock that ticks 100 times a second, and actions such as animation and refilling the buffer are not supposed to be able to happen more than once per "tick", to keep the juke from spinning its wheels rather than watching the keyboard.
Every x number of times through the idle loop, DWJukebox will tell Windows "Okay, go do something else for a bit", releasing its timeslice. This is where theere is theoretically the biggest chance of losing input. In this case, x is the CPUUsage setting times 10, so at 100 it will process 1000 times before it allows Windows to do something else. Looking at the code, this is probably not enough.
Tinkering with how this setting is applied, I cannot get the CPU usage over 50% (300,000 loops/sec) on my system. I used to be able to peg out the CPU. It is probably not a coincidence that this is a dual-core system, so that may have something to do with it.