线程优先级

线程的优先级共有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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容