【发布时间】:2014-05-06 06:46:45
【问题描述】:
我想在我的程序中应用最大线程数的 boost group_thread。例如
int maxNumberOfThreads
boost::thread_group group;
for (int i = 0; i < N; ++i)
//create new if group.size() is smaller then maximal number of threads
group.create_thread(Worker);
group.join_all();
有人知道我如何实现这一点吗?
因为当我启动N个线程时它会非常低效。
感谢您的帮助
【问题讨论】:
标签: c++ multithreading boost