Set thread priority in windows

Windows has scheduling priorities

And I would like to set the priorities of threads in rust. I need to set my threadpool at a lower priority so that it doesn’t cause my screen recording software to freeze up.

Rust has a thread-priority crate, but it looks like it only works on linux pthreads. Is there a way I can set thread priority on windows?


1 Like

In case there is no portable way around at this point in time, maybe asking the winapi crate directly using the thread’s raw handle could help you?

Thanks! That worked to change the thread priority. Although, what actually fixed my problem was going into task manager and raising the process priority of my recording software.