网站首页  词典首页

请输入您要查询的函数:

 

术语 switchtothread
释义 SwitchToThread
语法:
C++
BOOL WINAPI SwitchToThread(void);
SwitchToThread功能
导致调用线程,收益率执行另一个线程准备运行当前的处理器。操作系统的选择下一个要执行的线程。
参数
这个函数没有参数。
返回值
如果调用SwitchToThread函数导致操作系统切换到另一个线程的执行,则返回值为非零。
如果没有准备好执行其他线程,操作系统不切换到另一个线程的执行,并返回值是零。
备注
执行的产量实际上是长达一个线程调度时间片。在此之后,操作系统重新安排执行线程的收益。在重新确定由屈服线程的优先级和其他线程地位,并可以运行。
注意:执行的产量限制在调用线程的处理器。操作系统将不切换到另一个处理器的执行,即使该处理器闲置或运行的低优先级的线程。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0400或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
进程和线程函数
SuspendThread
暂停线程的执行
主题
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SwitchToThread Function
Causes the calling thread to yield execution to another thread that is ready to run on the current processor. The operating system selects the next thread to be executed.
Syntax
C++
BOOL WINAPI SwitchToThread(void);
Parameters
This function has no parameters.
Return Value
If calling the SwitchToThread function causes the operating system to switch execution to another thread, the return value is nonzero.
If there are no other threads ready to execute, the operating system does not switch execution to another thread, and the return value is zero.
Remarks
The yield of execution is in effect for up to one thread-scheduling time slice. After that, the operating system reschedules execution for the yielding thread. The rescheduling is determined by the priority of the yielding thread and the status of other threads that are available to run.
Note The yield of execution is limited to the processor of the calling thread. The operating system will not switch execution to another processor, even if that processor is idle or is running a thread of lower priority.
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
Process and Thread Functions
SuspendThread
Suspending Thread Execution
Threads
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686352(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 13:22:59