术语 | setthreadidealprocessor |
释义 | SetThreadIdealProcessor 语法: C++ DWORD WINAPI SetThreadIdealProcessor( __in HANDLE hThread, __in DWORD dwIdealProcessor ); SetThreadIdealProcessor功能 设置一个线程的首选处理器。该系统调度线程他们尽可能的首选处理器。 在一个拥有6400多处理器的系统,这个功能设置的首选处理器在处理器组的调用线程分配逻辑处理器。使用SetThreadIdealProcessorEx函数指定组和处理器的首选处理器。 参数 hThread [in] 一个句柄,线程的首选处理器要设置。句柄必须有THREAD_SET_INFORMATION访问权限。有关更多信息,请参见线程安全和访问权限。 dwIdealProcessor [in] 该线程的首选处理器数量。此值是从零开始的。如果这个参数是MAXIMUM_PROCESSORS,函数返回不改变它目前的理想处理器。 返回值 如果函数成功,返回值是以前的首选处理器。 如果函数失败,返回值为(DWORD值) - 1。为了获得更多错误信息,调用GetLastError。 备注 您可以使用的GetSystemInfo函数来确定处理器的数量在计算机上。您还可以使用GetProcessAffinityMask函数来检查线程上允许运行的处理器。请注意,GetProcessAffinityMask返回一个位掩码,而SetThreadIdealProcessor使用一个整数值来表示处理器。 要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0400或更高版本。有关详细信息,请参阅使用Windows头。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 GetProcessAffinityMask 的GetSystemInfo 多处理器 OpenThread 进程和线程函数 SetThreadAffinityMask SetThreadIdealProcessorEx 主题 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==SetThreadIdealProcessor Function Sets a preferred processor for a thread. The system schedules threads on their preferred processors whenever possible. On a system with more than 64 processors, this function sets the preferred processor to a logical processor in the processor group to which the calling thread is assigned. Use the SetThreadIdealProcessorEx function to specify a processor group and preferred processor. Syntax C++ DWORD WINAPI SetThreadIdealProcessor( __in HANDLE hThread, __in DWORD dwIdealProcessor ); Parameters hThread [in] A handle to the thread whose preferred processor is to be set. The handle must have the THREAD_SET_INFORMATION access right. For more information, see Thread Security and Access Rights . dwIdealProcessor [in] The number of the preferred processor for the thread. This value is zero-based. If this parameter is MAXIMUM_PROCESSORS, the function returns the current ideal processor without changing it. Return Value If the function succeeds, the return value is the previous preferred processor. If the function fails, the return value is (DWORD) – 1. To get extended error information, call GetLastError . Remarks You can use the GetSystemInfo function to determine the number of processors on the computer. You can also use the GetProcessAffinityMask function to check the processors on which the thread is allowed to run. Note that GetProcessAffinityMask returns a bit mask whereas SetThreadIdealProcessor uses an integer value to represent the processor. To compile an application that uses this function, define _WIN32_WINNT as 0x0400 or later. For more information, see Using the Windows Headers . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also GetProcessAffinityMask GetSystemInfo Multiple Processors OpenThread Process and Thread Functions SetThreadAffinityMask SetThreadIdealProcessorEx Threads Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms686253(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。