in reply to Re^10: how to change process & thread priority on Win32 ?
in thread how to change process & thread priority on Win32 ?

I need to control the priorities of various longrunning jobs - some of which kick off threads with nonstandard priority settings which cause some to hog the cpu

Hmm. Remember that thread priorities are relative to the process' priority class. If you have a process that is hogging the cpu, it will be enough to drop it priority class below that of the other processes to prevent it from usurping their timeslices.

A THREAD_PRIORITY_HIGHEST thread in a BELOW_NORMAL_PRIORITY_CLASS process, will never starve a THREAD_PRIORITY_NORMAL thread in a NORMAL_PRIORITY_CLASS process. Ie. You should be able to disarm any process that is starving other processes by only adjusting it's priority class.

It may cause that process to be starved of cpu until the other processes have completed, but that simply means that whomever is boosting their priority to the detriment of others will rapidly learn that their antisocial behaviour will not be tolorated and will cease to do it.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^11: how to change process & thread priority on Win32 ?