/CPPSimpleThreadPool

基于C++11的简单线程池

Primary LanguageC++

CPPSimpleThreadPool

使用方法参考:

#include "ThreadPool.h"
#include <iostream>

using namespace std;
int main()
{
	ThreadPool pool;
	pool.start(4);
	for (size_t i = 0; i < 1024*1024; i++)
	{
		pool.addTask([=]()
		{
			cout << "i value is : " << i << endl;
		});
	}

    return 0;
}

参考来源: https://github.com/progschj/ThreadPool