Repository navigation
ppcexec: Avoid excessive timer polling in realtime mode - #235
Merged
Merged
Conversation
When the interpreter can run faster than realtime (depends on the host system's performance), we would end up checking timer more frequently. This is because the `max_cycles` value returned by `process_events()` was based on the absolute timer deadline converted to instruction counts. Once `g_icycles` got ahead of that value, we would check timers after every instruction. Instead, use the time remaining until the next timer to schedule an instruction batch relative to `g_icycles`, capped using the existing 500us polling interval.
mihaip
added a commit
to mihaip/infinite-mac
that referenced
this pull request
Oct 10, 2026
Required to make typing work better (BeOS appears to use the decrement interrupt or other CPU mechanism for the key repeat delay, and synthetic time was causing too many key events to be generated). With dingusdev/dingusppc#235 and mihaip/dingusppc@3386136 realtime mode should be reasonably efficient in the DingusPPC Emscripten build. For #237
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the interpreter can run faster than realtime (depends on the host system's performance), we would end up checking timer more frequently.
This is because the
max_cyclesvalue returned byprocess_events()was based on the absolute timer deadline converted to instruction counts. Onceg_icyclesgot ahead of that value, we would check timers after every instruction.Instead, use the time remaining until the next timer to schedule an instruction batch relative to
g_icycles, capped using the existing 500us polling interval.