术语 | createthreadpool |
释义 | CreateThreadpool 语法: C++ PTP_POOL WINAPI CreateThreadpool( __reserved PVOID reserved ); CreateThreadpool功能 分配一个新的线程池来执行回调。 参数 保留 这个参数是保留,必须为NULL。 返回值 如果函数成功,它返回一个TP_POOL结构代表新分配的线程池。 如果函数失败,返回NULL。要检索扩展的错误信息,调用GetLastError。 备注 在创建新的线程池,您应该调用SetThreadpoolThreadMaximum指定的线程池可以分配和SetThreadpoolThreadMinimum指定线程池中可用的最低人数最多。 要使用游泳池,您必须与关联池回调的环境。要创建回调环境,呼吁InitializeThreadpoolEnvironment。然后,调用SetThreadpoolCallbackPool关联与回调环境池。 释放线程池,调用CloseThreadpool。 要编译的应用程序使用此函数,定义为0x0600或更高_WIN32_WINNT。 实例 有关示例,请参阅使用线程池功能。 要求: client最低支持Vista server最低支持 Windows Server 2008 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 CloseThreadpool SetThreadpoolThreadMaximum SetThreadpoolThreadMinimum 线程池 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==CreateThreadpool Function Allocates a new pool of threads to execute callbacks. Syntax C++ PTP_POOL WINAPI CreateThreadpool( __reserved PVOID reserved ); Parameters reserved This parameter is reserved and must be NULL. Return Value If the function succeeds, it returns a TP_POOL structure representing the newly allocated thread pool. If function fails, it returns NULL. To retrieve extended error information, call GetLastError . Remarks After creating the new thread pool, you should call SetThreadpoolThreadMaximum to specify the maximum number of threads that the pool can allocate and SetThreadpoolThreadMinimum to specify the minimum number of threads available in the pool. To use the pool, you must associate the pool with a callback environment. To create the callback environment, call InitializeThreadpoolEnvironment . Then, call SetThreadpoolCallbackPool to associate the pool with the callback environment. To release the thread pool, call CloseThreadpool . To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher. Examples For an example, see Using the Thread Pool Functions . Requirements Minimum supported clientWindows Vista Minimum supported serverWindows Server 2008 HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also CloseThreadpool SetThreadpoolThreadMaximum SetThreadpoolThreadMinimum Thread Pools Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms682456(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。