线程的优先级共有32个(0~31)由所属进程的优先级和本身的优先级所决定
进程 | 线程 |
---|---|
REALTIME_PRIORITY_CLASS | THREAD_PRIORITY_TIME_CRITICAL |
HIGH_PRIORITY_CLASS | THREAD_PRIORITY_HIGHEST |
ABOVE_NORMAL_PRIORITY | THREAD_PRIORITY_ABOVE_NORMAL |
NORMAL_PRIORITY | THREAD_PRIORITY_NORMAL |
BELOW_NORMAL_PRIORITY | THREAD_PRIORITY_BELOW_NORMAL |
IDLE_PRIORITY | THREAD_PRIORITY_LOWEST |
THREAD_PRIORITY_IDLE |
然后也就没啥了= =
给函数了
SetPriorityClass();
hProcess [in]
A handle to the process.
The handle must have the PROCESS_SET_INFORMATION access right. For more information, see Process Security and Access Rights.
dwPriorityClass [in]
The priority class for the process. This parameter can be one of the following values.
SetThreadPriority();
hThread [in]
A handle to the thread whose priority value is to be set.
The handle must have the THREAD_SET_INFORMATION or THREAD_SET_LIMITED_INFORMATION access right. For more information, see Thread Security and Access Rights.
**Windows Server 2003 and Windows XP: **The handle must have the THREAD_SET_INFORMATION access right.
nPriority [in]
The priority value for the thread. This parameter can be one of the following values.