骑在牛背上看书

关注

boost::thread_group简单使用

骑在牛背上看书

关注

阅读 170

2022-12-01


类似线程池,demo如下:

#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <iostream>
void fun(int i) {
std::cout << "fun:" << i << std::endl;
}
int main() {
boost::thread_group threads;
for (auto i = 0;i < 10;i++) {
threads.create_thread(boost::bind(fun, i));
}
threads.join_all();

return 0;
}

相关推荐

cnlinkchina

Jmeter终极线程组“Ultimate Thread Group“如何使用?

cnlinkchina 28 0 0

RIOChing

jmeter线程组之Concurrency Thread Group

RIOChing 74 0 0

_刘彦辉

boost库使用

_刘彦辉 112 0 0

sullay

(八)【Jmeter】线程(Threads(Users))之bzm - Concurrency Thread Group

sullay 35 0 0

左小米z

《MySQL——group by使用tips》

左小米z 46 0 0

老王420

java线程的简单例子(Thread and runnable)

老王420 65 0 0

河南妞

​CentOS 7 安装Boost 1.55​ 没有生成libboost_thread-mt.so解决

河南妞 88 0 0

乐百川

(九)【Jmeter】线程(Threads(Users))之bzm-Free-Form Arrivals Thread Group

乐百川 11 0 0

我是小小懒

Jmeter如何安装jp@gc - Ultimate Thread Group插件(终极线程组)

我是小小懒 88 0 0

书呆鱼

你真的懂使用Group by?

书呆鱼 108 0 0

精彩评论(0)

0 0 举报