2014年4月23日
摘要: 1. 字节长度: short <= int <= long <= long long2. wchar_t,最大扩展字符集合;char16_t、char32_t,unocide字符集,用于表示所有自然语言中的字符。3. 存储的基本单元为 “字”(word),区分的最小单元 byte. word的长度两... 阅读全文
posted @ 2014-04-23 16:48 夏多 阅读(172) 评论(0) 推荐(0)
摘要: .PHONY : all cleanDEBUG := YESCC := gccCXX := g++LD := g++AR := ar rcHOME_PATH := $(realpath .)SOURCE_PATH := ${HOME_PATH}/srcINC_PATH := -I${HOME_PAT... 阅读全文
posted @ 2014-04-23 16:08 夏多 阅读(626) 评论(0) 推荐(0)
  2013年4月18日
摘要: OUT = test.exeSRC = ./main.cpp ./proto/message.pb.ccINC = ./proto/message.pb.hBOOST_INCLUDE = F:/boost_1_51_0BOOST_LIB = F:/boost_1_51_0/stage/lib/v9/libPROTO_LIB = C:/cygwin/usr/local/lib/PROTO_INCLUDE = C:/cygwin/usr/local/include/all : $(OUT)$(OUT) : $(SRC) g++ -w -ggdb -o $(OUT) $(SRC) -I$(P... 阅读全文
posted @ 2013-04-18 18:55 夏多 阅读(347) 评论(0) 推荐(0)
  2013年2月18日
摘要: 1.互斥量静态分配互斥量初始化:(1)设置为常量PTHREAD_MUTEX_INITIALIZER;(2)调用pthread_mutex_init初始化;动态分配互斥量初始化:调用pthread_mutex_init进行初始化。注意:释放内存前必须调用pthread_mutex_destroy.int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr);int pthread_mutex_destroy(pthread_mutex_t *mutex);互斥量加 阅读全文
posted @ 2013-02-18 14:58 夏多 阅读(309) 评论(0) 推荐(0)
  2013年2月17日
摘要: 1.相同进程环境下比较线程idint pthread_equal(pthread_t tid1, pthread_t tid2);2.线程获取自身idpthread_t pthread_self(void);3.线程创建int pthread_create(pthread_t *restrict tidp, const pthread_attr_t *restrict attr, void *(*start_rtn)(void), void *restrict arg);关于主线程和新线程之间的竞争,简单处理方式是可使主线程进行短暂休眠,确保新线程运行前主线程不会退出。新线程有可能在pthre 阅读全文
posted @ 2013-02-17 14:57 夏多 阅读(230) 评论(0) 推荐(0)