自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

转载 进程池

#ifndef PROCESSPOOL_H#define PROCESSPOOL_H#include #include #include #include #include #include #include #include #include #include #include #include #include #includ

2017-02-14 07:55:03 287

转载 信号量通信

这篇文章将讲述别一种进程间通信的机制——信号量。注意请不要把它与之前所说的信号混淆起来,信号与信号量是不同的两种事物。有关信号的更多内容,可以阅读我的另一篇文章:Linux进程间通信——使用信号。下面就进入信号量的讲解。一、什么是信号量为了防止出现因多个程序同时访问一个共享资源而引发的一系列问题,我们需要一种方法,它可以通过生成并使用令牌来授权,在任一时刻只能有一个执行线程访问代码

2017-02-10 23:23:21 893

转载 c++之巧用type_info

c++之巧用type_infoc++没有反射机制,我们可以通过c++的语言特性去实现同样的功能。本文介绍使用type_info实现的一些发射特性。1 type_info简介:class type_info {public: _CRTIMP virtual ~type_info(); _CRTIMP int operator==(const typ

2017-01-02 18:23:50 3569

转载 Mysql 查询缓存

Mysql 查询缓存 查询缓存的作用就是当查询接收到一个和之前同样的查询,服务器将会从查询缓存种检索结果,而不是再次分析和执行上次的查询。这样就大大提高了性能,节省时间。1.配置查询缓存 修改配置文件,修改[mysqld]下的query_cache_size和query_cache_type(如果没有则添加)。其中query_cache_size表示缓存的大小,而query_cac

2016-08-17 21:23:20 402

转载 Makefile中用宏定义进行条件编译

在源代码里面如果这样是定义的:#ifdef   MACRONAME//可选代码#endif那在makefile里面gcc   -D   MACRONAME=MACRODEF或者gcc   -D   MACRONAME 这样就定义了预处理宏,编译的时候可选代码就会被编译进去了。对于GCC编译器,有如下选项:        -D macro=string,等

2016-07-24 21:13:42 498

转载 信号量 与共享内存

#include #include #include #include #include #include #include #include int main(int argc,char *argv[]){    int running=1;    int shid;    int semid;    int value;    voi

2016-05-15 02:36:40 340

转载 消息对列的操作

#include#include#include#include#includestruct msgbuf{    int type;    char ptr[0];};int main(int argc,char *argv[]){    key_t key;    key=ftok(argv[1],100);    int msgid

2016-05-11 21:45:53 439

转载 pugixml操作

XML文件:xml version="1.0" encoding="GBK"?>root> ip>192.168.1.1ip>root>修改操作:void SaveToConfig( const wchar_t* xml_file, const wchar_t* ip ){ using namespace pugi; xml_document doc;

2016-05-10 23:37:53 1176

转载 boost导常使用

#include "stdafx.h"#include #include #include using namespace std;// 从std和boost,新的导常类就同时有它们两的能力struct both_exception : virtual boost::exception, virtual std::exception// 这里要用虚继承{};

2016-04-18 01:24:49 446

转载 thread 退出状态如何获取

#include #include #include #include using namespace std; #define NUM_THREADS 5 void* say_hello(void* args) { cout << "hello in thread " << *((i

2016-03-27 17:58:38 747

转载 boost中信号的应用

// signal.cpp : 定义控制台应用程序的入口点。///*#include "stdafx.h"#include "boost/utility/result_of.hpp"#include "boost/typeof/typeof.hpp"#include "boost/assign.hpp"#include "boost/ref.hpp"#include

2016-03-27 15:35:17 380

转载 boost 中 thread 的应用

// thread.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"/*#include #include #include void hello(){ std::cout Sleep(10000);}int main(){ boost::thread thrd(&hello); thrd.join(

2016-03-27 15:34:38 338

转载 boost 与 string 的应用

// string.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include#include #include #include using namespace std;using namespace boost;bool NotH(const char &ch){ if(ch == ' ' || ch == '

2016-03-27 15:31:19 352

转载 跟我一起写 Makefile

陈皓 概述 —— 什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional的程序员,makefile还是要懂。这就好像现在有这么多的HTML的编辑器,但如果你想成为一个专业人士,你还是要了解HTML的标识的含义。特别在Unix下的软件编译,你就不能不自己写makefi

2016-01-02 15:33:12 420

转载 Makefile的一种通用写法

管理Linux环境下的C/C++大型项目,如果有一个智能的Build System会起到事半功倍的效果,本文描述Linux环境下大型工程项目子目录Makefile的一种通用写法,使用该方法,当该子目录内的文件有增删时无需对Makefile进行改动,可以说相当的智能。下面先贴代码(为减小篇幅,一些非关键的代码被去掉,本方法的局限是用于一个C文件生成一个可执行文件的场合):ROOTDIR =

2016-01-02 15:03:38 514

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除