Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtime] More accurate timeouts with rdtsc #1226

Open
iyzhang opened this issue Apr 8, 2024 · 0 comments · May be fixed by #1305
Open

[runtime] More accurate timeouts with rdtsc #1226

iyzhang opened this issue Apr 8, 2024 · 0 comments · May be fixed by #1305
Assignees
Labels
enhancement Enhancement Request on an Existing Feature

Comments

@iyzhang
Copy link
Contributor

iyzhang commented Apr 8, 2024

Context

Currently we use a configurable value for timer resolution which is based on the number of iterations that we run the scheduler. Since our tasks vary in runtime, this is an extremely imprecise way to decide when to check the system time for a timeout.

Proposed Solution

Use rdtsc to estimate a cycle budget that matches how frequently we want to check the time. For example, 1 second = roughly 2.6 million cycles on a 2.6Ghz CPU. Once we run out the budget, we take the system time and figure out how long it actually took for each cycle. Then we adjust the budget for the next iteration based on that.

@iyzhang iyzhang added the enhancement Enhancement Request on an Existing Feature label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement Request on an Existing Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants