Windows中的线程池 [英] threadpool in windows
问题描述
嘿,
我是线程池的新手,我想先通过创建和销毁线程池来开始,我假设我们是如何创建线程池的:
PTP_POOL Pool = CreateThreadpool(NULL);
if(Pool!= NULL)
{
cout<<Pool Created<< endl;
}
代码构建正常,但是当我运行它,我得到以下弹出消息:
程序入口点Create Threadpool无法位于动态链接库KRENEL32.dll
Hey,
I am new to thread pools and well I wanted to start of by creating and destroying a thread pool first,I assume that''s how we create a thread pool:
PTP_POOL Pool = CreateThreadpool(NULL);
if(Pool!=NULL)
{
cout<<"Pool Created"<<endl;
}
the code builds fine,however when I run it,I get the following pop up message:
The procedure entry point Create Threadpool could not be located in the dynamic link library KRENEL32.dll
推荐答案
由于CPallini指出此API在运行时需要 Windows Vista 并且_WIN32_WINNT> = 0x0600
在编译时才能使用它。
有许多其他C ++线程池实现在Windows上运行良好,并且在Microsoft选择向自己公开API之前就存在了。尝试搜索代码项目中的线程池,你会看到。
As CPallini has pointed out this API requires Windows Vista at runtime and a_WIN32_WINNT >= 0x0600
at compile time in order to use it.
There are plenty of other C++ Thread Pool implementations which work very well on Windows and existed before Microsoft chose to expose an API to their own. Try searching Code Project for ''Thread Pool'' and you''ll see.
这篇关于Windows中的线程池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!