2015年6月22日

摘要: #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 阅读(331) 评论(0) 推荐(0)

2015年6月8日

摘要: 从windows角度来说,condition_variable类似event。 阻塞等待出发,不过condition_variable可以批量出发。 代码如下: 显示如下: start...thread 7thread 3thread 2thread 9thread 6thread 5thread 阅读全文
posted @ 2015-06-08 21:21 itdef 阅读(458) 评论(0) 推荐(0)

2015年6月7日

摘要: // 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 阅读(319) 评论(0) 推荐(0)
摘要: 没啥好讲的 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 阅读(391) 评论(0) 推荐(0)

2015年5月31日

摘要: 最近没时间捣鼓啥,也没什么内容可写。先把自己捣鼓的几个基础类放上来,已做记录namespace DEF{ class Noncopyable { protected: Noncopyable() {} ~Noncopyable() {} priva... 阅读全文
posted @ 2015-05-31 17:18 itdef 阅读(283) 评论(0) 推荐(0)

2015年5月29日

摘要: http://www.af360.com/html/2015/03/03/201503031538584471.shtmlhttp://fangluo.blog.bokee.net/http://www.af360.com/html/2015/03/03/201503031538584471.sht... 阅读全文
posted @ 2015-05-29 11:15 itdef 阅读(272) 评论(0) 推荐(0)

2015年3月29日

摘要: /********************************************************************/* @file* @author def* @blog http://www.cnblogs.com/itdef/ * @brief/************... 阅读全文
posted @ 2015-03-29 12:37 itdef 阅读(196) 评论(0) 推荐(0)

2015年3月26日

摘要: traits使用的场景一般有三种 分发到不同处理流程 解决C++代码中某些无法编译的问题 比如一个图书馆的代码,接受书籍并收入到不同类别中 template<class T> // T表示接受的是何种书籍 void AcceptBooks(T books) { ... //do something 阅读全文
posted @ 2015-03-26 21:51 itdef 阅读(375) 评论(0) 推荐(0)

2015年3月25日

摘要: #include "stdafx.h"#include #include using namespace std;int fcmp(const void* elem,const void* elem2);void sample1();void sample2();int _tmain(int arg... 阅读全文
posted @ 2015-03-25 20:47 itdef 阅读(185) 评论(0) 推荐(0)

2015年2月20日

摘要: vs2008windows平台监控内存性能(磁盘网络流量远程数据库记录待添加)使用方法vs2008编译完成后使用"WinPerforMonitor.exe-mem-log"执行即可-log命令行会在文件目录下新建一个文件记录内存使用率变化目前仅仅支持内存记录后继将添加cpu使用率磁盘分区占用率及网络... 阅读全文
posted @ 2015-02-20 19:25 itdef 阅读(527) 评论(0) 推荐(0)

导航