ProcessPriorityClass 枚举

定义

指示系统将与进程关联的优先级。 此值与进程的每个线程的优先级值一起来确定每个线程的基本优先级别。This value, together with the priority value of each thread of the process, determines each thread's base priority level.

public enum class ProcessPriorityClass
public enum ProcessPriorityClass
type ProcessPriorityClass = 
Public Enum ProcessPriorityClass
继承
ProcessPriorityClass

字段

AboveNormal 32768

指定进程的优先级高于 Normal 但低于 HighSpecifies that the process has priority higher than Normal but lower than High.

BelowNormal 16384

指定进程的优先级在 Idle 之上,但在 Normal 之下。Specifies that the process has priority above Idle but below Normal.

High 128

指定进程执行必须立即执行的时间关键任务,如 Task List 对话框,不管操作系统的负荷如何,用户调用该对话框后均必须迅速响应。Specifies that the process performs time-critical tasks that must be executed immediately, such as the Task List dialog, which must respond quickly when called by the user, regardless of the load on the operating system. 该进程的线程优先于普通或空闲优先级类进程的线程。The threads of the process preempt the threads of normal or idle priority class processes.
为进程的优先级类指定 High 这一个优先级时需谨慎,因为高优先级类应用程序几乎可以使用所有可用的处理器时间。Use extreme care when specifying High for the process's priority class, because a high priority class application can use nearly all available processor time.

Idle 64

指定此进程的线程只能在系统空闲时运行,如屏幕保护程序。Specifies that the threads of this process run only when the system is idle, such as a screen saver. 更高优先级类中运行的任何进程的线程都优先于此进程的线程。The threads of the process are preempted by the threads of any process running in a higher priority class. 此优先级类由子进程继承。This priority class is inherited by child processes.

Normal 32

指定进程没有特殊的安排需求。Specifies that the process has no special scheduling needs.

RealTime 256

指定进程拥有可能的最高优先级。Specifies that the process has the highest possible priority.
具有 RealTime 优先级的进程的线程抢占所有其他进程的线程,包括执行重要任务的操作系统进程。The threads of a process with RealTime priority preempt the threads of all other processes, including operating system processes performing important tasks. 因此,执行时间并不太短的 RealTime 优先级进程可能导致磁盘高速缓存不刷新或鼠标无响应。Thus, a RealTime priority process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive.

注解

进程优先级类包含一系列线程优先级别。A process priority class encompasses a range of thread priority levels. 进程中运行不同优先级的线程相对于进程的优先级类运行。Threads with different priorities running in the process run relative to the process's priority class. 操作系统使用所有可执行线程的基本优先级别来确定哪个线程获取处理器时间的下一扇区。The operating system uses the base-priority level of all executable threads to determine which thread gets the next slice of processor time.

Win32 使用四个优先级类, 每个类具有7个基本优先级别。Win32 uses four priority classes with seven base priority levels per class. 根据所用的时间或其他提升, 当某个进程需要在其他进程中进行访问以访问处理器时, 操作系统会更改基本优先级别。Based on time elapsed or other boosts, the operating system can change the base priority level when a process needs to be put ahead of others for access to the processor. 此外, 您还可以将PriorityBoostEnabled设置为暂时提升已进入等待状态的线程的优先级。In addition, you can set PriorityBoostEnabled to temporarily boost the priority level of threads that have been taken out of the wait state. 当进程返回到等待状态时, 将重置此优先级。The priority is reset when the process returns to the wait state.

适用于

另请参阅