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

c++ replay: more accurate sleep #22348

Merged
merged 4 commits into from
Sep 29, 2021
Merged

c++ replay: more accurate sleep #22348

merged 4 commits into from
Sep 29, 2021

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Sep 25, 2021

QThread::usleep is quite inaccurate. use nanosleep and spin lock for more accurate sleeping

@deanlee deanlee force-pushed the replay_sleep branch 2 times, most recently from 6417c85 to f198505 Compare September 25, 2021 18:42
@pd0wm pd0wm added the tools label Sep 25, 2021
@deanlee deanlee force-pushed the replay_sleep branch 3 times, most recently from 4059c21 to ab0f381 Compare September 28, 2021 08:00
@deanlee deanlee marked this pull request as ready for review September 28, 2021 11:30
@deanlee deanlee mentioned this pull request Sep 28, 2021
11 tasks
@deanlee
Copy link
Contributor Author

deanlee commented Sep 28, 2021

the CPU usage increased by 2%~5%, but it’s worth it

@adeebshihadeh
Copy link
Contributor

That's fine, but let's keep in mind that we want to be able to run this on C2 and C3 at some point too.

@deanlee
Copy link
Contributor Author

deanlee commented Sep 28, 2021

That's fine, but let's keep in mind that we want to be able to run this on C2 and C3 at some point too.

Ok i will pay attention to this.
precise_nano_sleep should be ok on c2 &c3

@pd0wm pd0wm merged commit 318a8ba into commaai:master Sep 29, 2021
@deanlee deanlee deleted the replay_sleep branch September 29, 2021 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants