LV2: Improve sys_timer_usleep by using CPU usermode waiting

* Linux: set timerslack to minimum value
- Linux delays the wakeup of threads to save power, this feature isn't needed for this application

* Utils: Add detection for waitpkg and monitorx extensions
- These instructions are used for user mode wait instructions

* lv2: Use user mode wait instructions instead of yielding when appropriate
This commit is contained in:
Whatcookie 2023-08-05 04:49:30 -04:00 committed by GitHub
parent aee97e414f
commit d4cf12bc17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 1 deletions

View file

@ -1049,6 +1049,11 @@ int main(int argc, char** argv)
}
}
// Set timerslack value for Linux. The default value is 50,000ns. Change this to just 1 since we value precise timers.
#ifdef __linux__
prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0);
#endif
#ifdef _WIN32
// Create dummy permanent low resolution timer to workaround messing with system timer resolution
QTimer* dummy_timer = new QTimer(app.data());