From what I understand, the priority class is just an request that the OS schedule the process in a certain fashion when it's dealing out time slices.
The OS tries to give each process equal time slices; it runs one process for a while, then switches to another, and so on rather than running one process until it yields then moving on (of course if you yield it moves on.) The priority helps the OS decide which process to schedule next.
Processes with RealTime priority are always at the front of the list; it will get assigned most (if not all) of the time slices because nothing is more important. If you look at the documentation for the High
priority, you see something neat: "The threads of the process preempt the threads of normal or idle priority class processes." This means that if the OS is deciding what to move to, and there's no other High
priority processes, this process will be selected. This can have the same effect as RealTime
: if there's only one high priority process it will take up all of the time slices. This pattern goes on all the way down to Idle
, which can only get a time slice when nothing else wants one.
If your process consumes tons of system resources, it's going to use them during its time slice. Some actions, like disk I/O, might have side effects even when your process doesn't have a time slice. The best you might be able to do if setting a low priority doesn't help is examine your loops and call Sleep(0)
liberally to yield your time slice quickly. I'd imagine doing this with an intensive compression operation might be a bad idea: if you're using a lot of RAM and the next process needs to use RAM, the OS has to page your stuff out and page the new process's stuff in; it may be better to use a higher
Someone else probably knows more than me though, and I invite them to make me look like a fool so I can learn something