网站首页  词典首页

请输入您要查询的函数:

 

术语 getthreadpriority
释义 GetThreadPriority
语法:
C++
int WINAPI GetThreadPriority(
__in HANDLE hThread
);
GetThreadPriority功能
检索指定线程的优先级值。此价值,加上线程的进程的优先级,决定了线程的基优先级。
参数
hThread [in]
句柄到线程。
句柄必须有THREAD_QUERY_INFORMATION或THREAD_QUERY_LIMITED_INFORMATION访问权限。有关更多信息,请参见线程安全和访问权限。
Windows Server 2003和Windows XP/2000操作系统:在处理必须有THREAD_QUERY_INFORMATION访问权限。
返回值
如果函数成功,返回值是线程的优先级。
如果函数失败,返回值是THREAD_PRIORITY_ERROR_RETURN。为了获得更多错误信息,调用GetLastError。
线程的优先级是下列值之一。
返回代码/ valueDescription
THREAD_PRIORITY_ABOVE_NORMAL
1Priority 1分以上的优先级。
THREAD_PRIORITY_BELOW_NORMAL
- 1Priority 1点下面的优先级。
THREAD_PRIORITY_HIGHEST
2Priority 2个百分点以上的优先级。
THREAD_PRIORITY_IDLE
- 15Base优先1 IDLE_PRIORITY_CLASS,BELOW_NORMAL_PRIORITY_CLASS,NORMAL_PRIORITY_CLASS,ABOVE_NORMAL_PRIORITY_CLASS,或HIGH_PRIORITY_CLASS流程,为REALTIME_PRIORITY_CLASS 16个基本优先级进程。
THREAD_PRIORITY_LOWEST
- 2Priority 2点下面的优先级。
THREAD_PRIORITY_NORMAL
0Normal优先的优先级。
THREAD_PRIORITY_TIME_CRITICAL
15Base - 15优先级别IDLE_PRIORITY_CLASS,BELOW_NORMAL_PRIORITY_CLASS,NORMAL_PRIORITY_CLASS,ABOVE_NORMAL_PRIORITY_CLASS,或HIGH_PRIORITY_CLASS流程,基础优先级31日为REALTIME_PRIORITY_CLASS进程。
如果线程有REALTIME_PRIORITY_CLASS基类,这个函数也可以返回一个下列值:-7,-6,-5,-4,-3,3,4,5或6。有关更多信息,请参阅调度优先级。
备注
每个线程都有一个基础优先级的线程的优先级值和其进程的优先级确定。操作系统使用的基本优先的所有可执行线程的级别,以确定哪个线程获取未来的CPU时间片。线程定于1轮在每个优先级循环方式,只有当有更高层次上没有可执行线程将安排在一个较低的Level,线程发生。
对于一个表,显示了基地,为每个优先级和线程的优先级值的组合优先级别,请参阅SetPriorityClass功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
GetPriorityClass
OpenThread
进程和线程函数
调度优先级
SetPriorityClass
SetThreadPriority
主题
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetThreadPriority Function
Retrieves the priority value for the specified thread. This value, together with the priority class of the thread's process, determines the thread's base-priority level.
Syntax
C++
int WINAPI GetThreadPriority(
__in HANDLE hThread
);
Parameters
hThread [in]
A handle to the thread.
The handle must have the THREAD_QUERY_INFORMATION or THREAD_QUERY_LIMITED_INFORMATION access right. For more information, see Thread Security and Access Rights .
Windows Server 2003 and Windows XP/2000: The handle must have the THREAD_QUERY_INFORMATION access right.
Return Value
If the function succeeds, the return value is the thread's priority level.
If the function fails, the return value is THREAD_PRIORITY_ERROR_RETURN. To get extended error information, call GetLastError .
The thread's priority level is one of the following values.
Return code/valueDescription
THREAD_PRIORITY_ABOVE_NORMAL
1Priority 1 point above the priority class.
THREAD_PRIORITY_BELOW_NORMAL
-1Priority 1 point below the priority class.
THREAD_PRIORITY_HIGHEST
2Priority 2 points above the priority class.
THREAD_PRIORITY_IDLE
-15Base priority 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 of 16 for REALTIME_PRIORITY_CLASS processes.
THREAD_PRIORITY_LOWEST
-2Priority 2 points below the priority class.
THREAD_PRIORITY_NORMAL
0Normal priority for the priority class.
THREAD_PRIORITY_TIME_CRITICAL
15Base-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.

If the thread has the REALTIME_PRIORITY_CLASS base class, this function can also return one of the following values: -7, -6, -5, -4, -3, 3, 4, 5, or 6. For more information, see Scheduling Priorities .
Remarks
Every thread has a base-priority level determined by the thread's priority value and the priority class of its process. The operating system uses the base-priority level of all executable threads to determine which thread gets the next slice of CPU time. Threads are scheduled in a round-robin fashion at each priority level, and only when there are no executable threads at a higher level will scheduling of threads at a lower level take place.
For a table that shows the base-priority levels for each combination of priority class and thread priority value, refer to the SetPriorityClass function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
GetPriorityClass
OpenThread
Process and Thread Functions
Scheduling Priorities
SetPriorityClass
SetThreadPriority
Threads
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683235(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:29:18