The thread-priority crate can be used to tell the OS' thread scheduler how to treat a thread. Adjusting the priority may or may not alleviate some of the crackling issues we've been having reported to us in Veloren.
I believe the relevant thread is the one spawned in crates/kira/src/backend/cpal/desktop/stream_manager.rs, so in this case we would replace the std::thread::spawn call with a thread_priority::spawn one, which takes an extra thread_priority::ThreadPriority argument.
As for what the ThreadPriority value should be, it could just be a higher than normal CrossPlatform value, or some kind of Deadline one.
See this commit for a simple example of how each value can be used in Veloren.
The thread-priority crate can be used to tell the OS' thread scheduler how to treat a thread. Adjusting the priority may or may not alleviate some of the crackling issues we've been having reported to us in Veloren.
I believe the relevant thread is the one spawned in
crates/kira/src/backend/cpal/desktop/stream_manager.rs, so in this case we would replace thestd::thread::spawncall with athread_priority::spawnone, which takes an extrathread_priority::ThreadPriorityargument.As for what the
ThreadPriorityvalue should be, it could just be a higher than normalCrossPlatformvalue, or some kind ofDeadlineone.See this commit for a simple example of how each value can be used in Veloren.