注意!GetThreadPriority的返回值不是系统的优先级值
2014-02-17 15:41
239 查看
GetThreadPriority的返回值
系统的优先级值
windows核心编程 5th 184页
参考资源:
GetThreadPriority function
Scheduling Priorities
Return code/value | Description |
---|---|
THREAD_PRIORITY_ABOVE_NORMAL1 | Priority 1 point above the priority class. |
THREAD_PRIORITY_BELOW_NORMAL-1 | Priority 1 point below the priority class. |
THREAD_PRIORITY_HIGHEST2 | Priority 2 points above the priority class. |
THREAD_PRIORITY_IDLE-15 | Base priority of 1 for IDLE_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASSprocesses, and a base priority of 16 forREALTIME_PRIORITY_CLASS processes. |
THREAD_PRIORITY_LOWEST-2 | Priority 2 points below the priority class. |
THREAD_PRIORITY_NORMAL0 | Normal priority for the priority class. |
THREAD_PRIORITY_TIME_CRITICAL15 | Base-priority level of 15 for IDLE_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS,ABOVE_NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASSprocesses, and a base-priority level of 31 forREALTIME_PRIORITY_CLASS processes. |
Process priority class | Thread priority level | Base priority |
---|---|---|
IDLE_PRIORITY_CLASS | THREAD_PRIORITY_IDLE | 1 |
THREAD_PRIORITY_LOWEST | 2 | |
THREAD_PRIORITY_BELOW_NORMAL | 3 | |
THREAD_PRIORITY_NORMAL | 4 | |
THREAD_PRIORITY_ABOVE_NORMAL | 5 | |
THREAD_PRIORITY_HIGHEST | 6 | |
THREAD_PRIORITY_TIME_CRITICAL | 15 | |
BELOW_NORMAL_PRIORITY_CLASS | THREAD_PRIORITY_IDLE | 1 |
THREAD_PRIORITY_LOWEST | 4 | |
THREAD_PRIORITY_BELOW_NORMAL | 5 | |
THREAD_PRIORITY_NORMAL | 6 | |
THREAD_PRIORITY_ABOVE_NORMAL | 7 | |
THREAD_PRIORITY_HIGHEST | 8 | |
THREAD_PRIORITY_TIME_CRITICAL | 15 | |
NORMAL_PRIORITY_CLASS | THREAD_PRIORITY_IDLE | 1 |
THREAD_PRIORITY_LOWEST | 6 | |
THREAD_PRIORITY_BELOW_NORMAL | 7 | |
THREAD_PRIORITY_NORMAL | 8 | |
THREAD_PRIORITY_ABOVE_NORMAL | 9 | |
THREAD_PRIORITY_HIGHEST | 10 | |
THREAD_PRIORITY_TIME_CRITICAL | 15 | |
ABOVE_NORMAL_PRIORITY_CLASS | THREAD_PRIORITY_IDLE | 1 |
THREAD_PRIORITY_LOWEST | 8 | |
THREAD_PRIORITY_BELOW_NORMAL | 9 | |
THREAD_PRIORITY_NORMAL | 10 | |
THREAD_PRIORITY_ABOVE_NORMAL | 11 | |
THREAD_PRIORITY_HIGHEST | 12 | |
THREAD_PRIORITY_TIME_CRITICAL | 15 | |
HIGH_PRIORITY_CLASS | THREAD_PRIORITY_IDLE | 1 |
THREAD_PRIORITY_LOWEST | 11 | |
THREAD_PRIORITY_BELOW_NORMAL | 12 | |
THREAD_PRIORITY_NORMAL | 13 | |
THREAD_PRIORITY_ABOVE_NORMAL | 14 | |
THREAD_PRIORITY_HIGHEST | 15 | |
THREAD_PRIORITY_TIME_CRITICAL | 15 | |
REALTIME_PRIORITY_CLASS | THREAD_PRIORITY_IDLE | 16 |
THREAD_PRIORITY_LOWEST | 22 | |
THREAD_PRIORITY_BELOW_NORMAL | 23 | |
THREAD_PRIORITY_NORMAL | 24 | |
THREAD_PRIORITY_ABOVE_NORMAL | 25 | |
THREAD_PRIORITY_HIGHEST | 26 | |
THREAD_PRIORITY_TIME_CRITICAL | 31 |
Windows并没有提供返回线程优先级的函数。这一遗漏是Microsoft故意的。请记住Microsoft保留了任何时候改变调度算法的权利。我们设计的应用程序不应该了解调度算法具体细节。如果我们始终使用进程优先级类和相对线程优先级,那么我们的应用程序在现在和在操作系统的未来版本都可以运行得很好。
参考资源:
GetThreadPriority function
Scheduling Priorities
相关文章推荐
- 注意!GetThreadPriority的返回值不是系统的优先级值
- 进程优先级之getpriority系统调用
- SetThreadPriority__win32 线程优先级
- java Runtime.getRuntime().exec 调用系统脚本/命令注意事项
- win32 线程优先级 SetThreadPriority
- 改变线程优先级Change Thread Priority
- android 改变线程优先级Change Thread Priority
- 线程优先级SetThreadPriority的使用
- ceSetThreadPriority设置线程的优先级
- GetThreadContext注意点
- 线程间通信 1全局变量2当前主对话框指针3发消息方式4 AfxBeginThread的返回值(为CWinThread类型的指针)5AfxGetApp
- win32 API LoadImage()错误:返回值为0,GetLastError提示错误为“系统找不到指定的文件”
- 0.ring3-hook-GetThreadContext注意点(获取threadcontext错误点)
- ARM官方《CMSIS-RTOS教程》之线程的管理和优先级Thread Management and Priority
- ceSetThreadPriority设置线程优先级~!
- java Runtime.getRuntime().exec 调用系统脚本/命令注意事项
- What is Java thread priority? 什么是java线程优先级
- C++线程优先级SetThreadPriority的使用实例
- SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数