摘要: Outline- 1.线程特点- 2.pthread创建- 3.pthread终止 - 4.mutex互斥量使用框架 - 5.cond条件变量 - 6.综合实例================================================================================================1. 线程特点线程拥有自己独立的栈、调度优先级和策略、信号屏蔽字(创建时继承)、errno变量以及线程私有数据。进程的其他地址空间均被所有线程所共享,因此线程可以访问程序的全局变量和堆中分配的数据,并通过同步机制保证对数据访问的一... 阅读全文
posted @ 2013-01-07 17:31 度娘818 阅读(702) 评论(0) 推荐(0) 编辑
摘要: Google test is a framework for writing C++ unit tests. In this short post, I explain how to set it up in Ubuntu.Start by installing the gtest development package:sudo apt-get install libgtest-devNote that this package only install source files. You have to compile the code yourself to create the nec 阅读全文
posted @ 2013-01-07 16:52 度娘818 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 于是开始找跨平台的编译工具,其中最有名的两个是 cmake 和 scons,cmake 之所以出名估计是因为 KDE 4 从 autotools 转向用 cmake 来编译。而 scons 则是 lighttpd 原来用的编译工具,它现在也转向 Python 了。cmake 和 python 大概代表了新一代跨平台编译工具的两种方向。第一种 (cmake) 是延续并改良传统 automake, autoconf 工具链,将之合为一体,但最终仍然生成 Makefile, Visual Studio 的 .sln,Xcode 的 .xcodebuild 文件,依赖现有编译工具 (make, nma 阅读全文
posted @ 2013-01-07 16:51 度娘818 阅读(1182) 评论(0) 推荐(0) 编辑