这是MSDN的解释,有两个不理解:
THREAD_PRIORITY_ABOVE_NORMAL
Indicates 1 point above normal priority for the priority class.
比正常优先级高1THREAD_PRIORITY_BELOW_NORMAL
Indicates 1 point below normal priority for the priority class.
比正常优先级低1THREAD_PRIORITY_HIGHEST
Indicates 2 points above normal priority for the priority class.
比正常优先级高2THREAD_PRIORITY_LOWEST
Indicates 2 points below normal priority for the priority class.
比正常优先级低2THREAD_PRIORITY_NORMAL
Indicates normal priority for the priority class.
正常优先级THREAD_PRIORITY_IDLE
Indicates a base priority level of 1 for IDLE_PRIORITY_CLASS,
BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS,
ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a
base priority level of 16 for REALTIME_PRIORITY_CLASS processes.
这个。?THREAD_PRIORITY_TIME_CRITICAL
Indicates a base priority level of 15 for IDLE_PRIORITY_CLASS,
BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS,
ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a
base priority level of 31 for REALTIME_PRIORITY_CLASS processes.
这个我也不明白哪位给解释一下后面这两个比之上面5个的高低?
THREAD_PRIORITY_ABOVE_NORMAL
Indicates 1 point above normal priority for the priority class.
比正常优先级高1THREAD_PRIORITY_BELOW_NORMAL
Indicates 1 point below normal priority for the priority class.
比正常优先级低1THREAD_PRIORITY_HIGHEST
Indicates 2 points above normal priority for the priority class.
比正常优先级高2THREAD_PRIORITY_LOWEST
Indicates 2 points below normal priority for the priority class.
比正常优先级低2THREAD_PRIORITY_NORMAL
Indicates normal priority for the priority class.
正常优先级THREAD_PRIORITY_IDLE
Indicates a base priority level of 1 for IDLE_PRIORITY_CLASS,
BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS,
ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a
base priority level of 16 for REALTIME_PRIORITY_CLASS processes.
这个。?THREAD_PRIORITY_TIME_CRITICAL
Indicates a base priority level of 15 for IDLE_PRIORITY_CLASS,
BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS,
ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a
base priority level of 31 for REALTIME_PRIORITY_CLASS processes.
这个我也不明白哪位给解释一下后面这两个比之上面5个的高低?
基优先级 进程优先级类 线程优先级别
1 IDLE_PRIORITY_CLASS THREAD_PRIORITY_IDLE
1 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE
1 NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE
1 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE
1 HIGH_PRIORITY_CLASS THREAD_PRIORITY_IDLE
16 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_IDLE当线程优先级设置THREAD_PRIORITY_TIME_CRITICAL时,线程的基优先级与所属进程的优先级类的关系如下表示:
基优先级 进程优先级类 线程优先级别
15 IDLE_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
15 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
15 NORMAL_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
15 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
15 HIGH_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
31 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
详见
Platform SDK: DLLs, Processes, and Threads
Scheduling Priorities