Set thread priority in windows


#1

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?

Thanks


#2

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?


#3

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.