06 2015 档案

c++11 改进设计模式 Singleton模式
摘要:关于学习 《深入应用c++11》的代码笔记:c++11之前是这么实现的templateclass Singleton{public: static T* Instance(){ if (m_pInstance == nullptr) m_pInstance = new T(); return... 阅读全文

posted @ 2015-06-28 22:56 itdef 阅读(1093) 评论(0) 推荐(0) 编辑

c++11多线程学习笔记之四 生产消费者
摘要:#ifndef MY_QUEUE_H__#define MY_QUEUE_H__#include#include#include#include#include template class SyncQueue{public: SyncQueue(int maxSize = 10) :maxSiz... 阅读全文

posted @ 2015-06-22 12:48 itdef 阅读(323) 评论(0) 推荐(0) 编辑

c++11多线程学习笔记之三 condition_variable使用
摘要:从windows角度来说,condition_variable类似event。 阻塞等待出发,不过condition_variable可以批量出发。 代码如下: 显示如下: start...thread 7thread 3thread 2thread 9thread 6thread 5thread 阅读全文

posted @ 2015-06-08 21:21 itdef 阅读(449) 评论(0) 推荐(0) 编辑

c++11多线程学习笔记之二 mutex使用
摘要:// 1111111.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include int gcounter = 0;std::mutex gmtx; std::mutex gmtxOutput;voi... 阅读全文

posted @ 2015-06-07 21:29 itdef 阅读(312) 评论(0) 推荐(0) 编辑

c++11多线程学习笔记之一 thread基础使用
摘要:没啥好讲的 c++11 thread类的基本使用#include "stdafx.h"#include #include void Func(int n){ for (int i = 0; i < 3; ++i) std::cout << "func " << i << std::endl;}vo... 阅读全文

posted @ 2015-06-07 21:11 itdef 阅读(381) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示