


Only kernel mode threads can run at priority zero. Ordinary applications cannot request running at priority 0 through the normal APIs. You'll notice that there is no "0" on the table. It just means the thread or the process is willing to live with CPU cycles that nobody else wants. For example, a compute-bound task like video rendering should be set to a lower-than-normal priority, to avoid interfering with interactive use of the system.)Īnd the "idle" process class, and the "idle" thread priority within a process, does not mean nothing will be done by that process or that thread. In practice, very few developers ever bother. And within each process, the developer is supposed to set the thread priorities similarly, relative to a "normal" thread within the process. "Highest" is not the highest thread priority, "lowest" is not the lowest, "idle" does not mean you are not or will not be doing anything, and "realtime" does not guarantee scheduling behavior suitable for real-time work (it's just more predictable than the non-realtime classes, partly because it's above them all, and partly because automatic priority adjustment is turned off in the "realtime" class).įor processes, one is supposed to use the process classes to indicate how important - or not - it is for each process to get CPU time, relative to a "normal" process. There are a lot of "name anomalies" in this table. If you change the priority class of a process (say with Task Manager) then every thread's base priority changes according to the table. In a "normal" process, setting a thread to THREAD_PRIORITY_HIGHEST sets that thread's base priority to 10. Programs can change the priorities of their own threads within their process class. To create a thread with other than the "normal" thread priority, you have to create the thread and then change its priority later with SetThreadPriority.) (Oddly, the CreateProcess API takes an argument for the process class, but CreateThread does not. If the process is of the "normal" process class, then that means the thread has a base priority of 8. Every thread is created with the "normal" thread priority. The process class is used only to initialize the priority of threads created within the process. Note that Task Manager (at least in Windows 10) labels the "Idle" priority class as "Low" (probably to avoid confusion with the idle process, etc.). The "Base priority" column in Task Manager is showing you the process class (called "process priority class" in some docs). This table used to be fairly easy to find at and countless other places.
