![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL
Krishna_Lee
这个作者很懒,什么都没留下…
展开
-
stl-thread-001
介绍c++11引入的标准线程类thread,属于入门系列。 这是第一篇,转自c++标准库:开2个子线程运行,并取得结果;#include<future> #include<thread> #include<iostream> #include<random> #include<chrono> #include<exception> using std::cout; using std::endl;转载 2016-04-06 14:04:40 · 479 阅读 · 0 评论 -
stl-thread-002
第一篇讲的是高级线程函数async(); 第二篇,这篇讲低级线程函数thread(),和它的promise-结果收集器。#include<iostream> #include<thread> #include<future> #include<string> #include<exception> #include<stdexcept> #include<functional> #include<转载 2016-04-06 14:14:56 · 278 阅读 · 0 评论 -
stl-thread-003
以package线程包,封装函数的方式,使一个函数通常(但不一定)运行于某一分离线程中:#include<thread> #include<future> #include<iostream> using std::cout; using std::endl;double calc(double x, double y) { return x + y; }int main() { s转载 2016-04-06 14:19:51 · 270 阅读 · 0 评论