• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
我是张洪铭我是熊博士
时光静好,与君同;细水长流,与君语
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 5 6 7 ··· 47 下一页
2021年10月4日
std::get<C++11多线程库~线程管理>(09):运行时决定线程数量
摘要: 1 #include <QCoreApplication> 2 #include <thread> 3 #include <iostream> 4 #include <algorithm> 5 #include <vector> 6 7 /* 8 * 话题1: 运行时决定线程的数量。 9 * 线程的 阅读全文
posted @ 2021-10-04 15:09 我是张洪铭我是熊博士 阅读(128) 评论(0) 推荐(0)
C++多线程库的常用函数 std::thread::hardware_concurrency()
摘要: 格式:函数 + 头文件 + 用例 + 解释说明 1. 函数 std::thread::hardware_concurrency() 头文件 #include <thread> 用例 unsigned long const hardware_threads = std::thread::hardwar 阅读全文
posted @ 2021-10-04 14:29 我是张洪铭我是熊博士 阅读(1621) 评论(0) 推荐(0)
2021年10月3日
STL 算法 std::mem_fn
摘要: std::for_each(threads.begin(),threads.end(), std::mem_fn(&std::thread::join)); 1. 说明 2. 写用法 3.写样例 直接参考 cplusplus官网讲解:http://www.cplusplus.com/referenc 阅读全文
posted @ 2021-10-03 17:49 我是张洪铭我是熊博士 阅读(656) 评论(0) 推荐(0)
STL 算法 std::advance
摘要: std::advance(block_end,block_size); 1. 写说明 2. 写用法 3.写样例 直接参考 cplusplus官网讲解:http://www.cplusplus.com/reference/iterator/advance/ 我的理解: std::advance 第一个 阅读全文
posted @ 2021-10-03 17:45 我是张洪铭我是熊博士 阅读(3040) 评论(0) 推荐(0)
STL 算法 std::min
摘要: 1 unsigned long const num_threads= 2 std::min(hardware_threads != 0 ? hardware_threads : 2, max_threads); 1. 写说明 2. 写用法 3.写样例 未完,待续.... 阅读全文
posted @ 2021-10-03 17:40 我是张洪铭我是熊博士 阅读(212) 评论(0) 推荐(0)
STL 算法 std::distance
摘要: unsigned long const length=std::distance(first,last); 1. 写说明 2. 写用法 3.写样例 未完,待续.... 阅读全文
posted @ 2021-10-03 17:36 我是张洪铭我是熊博士 阅读(430) 评论(0) 推荐(0)
STL 算法 std::accumulate
摘要: 1. 写说明 2. 写用法 3.写样例 未完,待续.... 阅读全文
posted @ 2021-10-03 17:35 我是张洪铭我是熊博士 阅读(54) 评论(0) 推荐(0)
2021年10月1日
std::get<C++11多线程库~线程管理>(08):转移线程所有权(2)
摘要: 1 /* 2 * 话题1:基于“转移线程的所有权”,改进 thread_guard 类, 确保 std::thread 可以被 join或detach。 3 * 类 Scoped_thread 的构造函数把参数传递的 std::thread 拥有的所有权转移到自身成员变量上。 4 * 如果参数传递的 阅读全文
posted @ 2021-10-01 11:32 我是张洪铭我是熊博士 阅读(87) 评论(0) 推荐(0)
std::get<C++11多线程库~线程管理>(08):转移线程所有权(1)
摘要: 1 #include <QCoreApplication> 2 #include <thread> 3 #include <iostream> 4 5 /* 6 * 话题1:转移线程的所有权。 7 * std::thread 构造函数需传入一个函数或可调用对象, 每一个 std::thread 都关 阅读全文
posted @ 2021-10-01 10:48 我是张洪铭我是熊博士 阅读(94) 评论(0) 推荐(0)
2021年9月25日
std::get<C++11多线程库>(07):向线程函数传递参数(5)
摘要: 1 //! [3] *引用/指针 语义下变量地址情况回顾* 2 int main(int argc, char *argv[]){ 3 4 int a = 10; //0x4ffe28 5 int &refa = a; //0x4ffe28 6 int *pa = &a; //0x4ffe28 7 阅读全文
posted @ 2021-09-25 18:29 我是张洪铭我是熊博士 阅读(61) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 47 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3