2014年6月17日

摘要: 一.boost::thread的创建 1.线程创建方法一: boost::shared_ptr writeThread_; boost::function0 f = boost::bind(&DBTaskMgr::execute, this); writeThread_ = bo... 阅读全文
posted @ 2014-06-17 20:09 米**饭 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 1.boost锁的概述: boost库中提供了mutex类与lock类,通过组合可以轻易的构建读写锁与互斥锁。2.mutex对象类(主要有两种): 1.boost::mutex(独占互斥类) -->有lock和unlock方法 2.boost::shared_mutex(共享互斥类) -->有... 阅读全文
posted @ 2014-06-17 16:49 米**饭 阅读(663) 评论(0) 推荐(0) 编辑
摘要: #include void sort(int &a, int &b){ if (a>=b) { return; } if (a<b) { int temp = a; a = b; b = temp; }}int main(int arg... 阅读全文
posted @ 2014-06-17 14:35 米**饭 阅读(227) 评论(0) 推荐(0) 编辑

导航