SetThreadPriority
来源:互联网 发布:mac系统实用软件 编辑:程序博客网 时间:2024/06/04 18:45
#include <stdio.h>#include <windows.h>DWORD WINAPI ThreadProc(LPVOID lpParameter);int main( void ){HANDLE Thread=CreateThread(NULL,NULL,ThreadProc,NULL,CREATE_SUSPENDED ,NULL);//设置线程优先级SetThreadPriority(Thread,THREAD_PRIORITY_TIME_CRITICAL);ResumeThread(Thread);SuspendThread(Thread);ResumeThread(Thread);//获取线程优先级switch (GetThreadPriority(Thread)){case THREAD_PRIORITY_TIME_CRITICAL:{printf("THREAD_PRIORITY_TIME_CRITICAL\n");}break;case THREAD_PRIORITY_HIGHEST:{printf("THREAD_PRIORITY_HIGHEST\n");}break;case THREAD_PRIORITY_ABOVE_NORMAL:{printf("THREAD_PRIORITY_ABOVE_NORMAL\n");}break;case THREAD_PRIORITY_NORMAL:{printf("THREAD_PRIORITY_NORMAL\n");}break;case THREAD_PRIORITY_BELOW_NORMAL:{printf("THREAD_PRIORITY_BELOW_NORMAL\n");}break;case THREAD_PRIORITY_LOWEST:{printf("THREAD_PRIORITY_LOWEST\n");}break;case THREAD_PRIORITY_IDLE:{printf("THREAD_PRIORITY_IDLE\n");}break;default:printf("default\n");}getchar();CloseHandle(Thread);return 0;}DWORD WINAPI ThreadProc( LPVOID lpParameter ){printf("哈哈\n");getchar();return true;}/*idle (最低)THREAD_PRIORITY_IDLE 如果进程优先级为realtime则调整为16,其它情况为1 LOWEST 低 THREAD_PRIORITY_LOWEST -2(在原有基础上-2) BELOW 低于标准 THREAD_PRIORITY_BELOW_NORMAL -1(在原有基础上-1) NORMAL(标准) THREAD_PRIORITY_NORMAL 不变(取进程优先级值) ABOVE 高于标准 THREAD_PRIORITY_ABOVE_NORMAL +1(在原有基础上+1) HIGHEST (高) THREAD_PRIORITY_HIGHEST +2(在原有基础上+2) CRITICAL(最高) THREAD_PRIORITY_TIME_CRITICAL 如果进程优先级为realtime则调整为31,其它情况为15 */
0 0
- SetThreadPriority
- SetThreadPriority()函数
- SetThreadPriority和GetThreadPriority函数
- SetThreadPriority和GetThreadPriority
- Windows API 中的SetThreadPriority()
- SetThreadPriority和GetThreadPriority函数
- 慎用Android Process setThreadPriority
- win32 线程优先级 SetThreadPriority
- 线程优先级SetThreadPriority的使用
- Windows API---SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- Windows API一日一练(49)SetThreadPriority和GetThreadPriority函数
- 运维最恨4件事:开发同学能帮忙做点啥?
- 线程
- 绘制曲线设置颜色和样式
- Shell_环境变量
- 注释二三事
- SetThreadPriority
- spring配置定时器的时间设置
- 最短摘要的生成
- Node.js 异步编程之 Callback
- 2-m-Add Two Numbers
- Surface+MediaPlayer显示视频
- android 入门教程
- 思科交换机出厂配置
- VMware 的Ubuntu下安装和配置Ganglia