【文件属性】:
文件名称:ThreadPool_Cpp:ThreadPool:C ++ 17,仅标头,std :: future
文件大小:10KB
文件格式:ZIP
更新时间:2021-02-25 18:25:10
C++
线程池
C ++中的线程池
主要特点
C ++ 17
仅标题
std :: future
仅使用一个互斥锁即可添加多个任务
如何使用
添加任务
int Function1 ( int & num);
int Function2 ( int num);
void Function3 ();
{ // I recommend declare ThreadPool inside of scope for resource hadling
ThreadPool< 5> threadPool; // Pass With Thread Pool Size(Worker Count)
int a = 5 ;
// Push Tasks
std::future< int> future1 = threadPool. AddTask (Function1, std::ref (a));
【文件预览】:
ThreadPool_Cpp-master
----.gitmodules(113B)
----concurrentqueue()
----ThreadPool.h(10KB)
----LICENSE(1KB)
----Examples()
--------example.cpp(2KB)
--------example2.cpp(2KB)
----.gitignore(6KB)
----README.md(3KB)