I know a lot of thread launching API calls allow specifying a priority on launch, but this doesn’t account for dynamic levels of load. I’m also aware programs that target a certain amount of loops per second can work out the duration that they took to finish an instruction, and sleep the thread for the rest of the duration
Lets say I have a thread that is recieving instructions from a user and can have varying loads. Sometimes it might be recieving thousands of instructions without a break, and sometimes it might be sat idle for extended periods. What is the preferred way to adjust the priority that the OS gives to this thread depending on load, and is this something that would be desirable to do?
3