12 2013 档案

摘要:在POSIX多线程【一】:简单队列simple queue的基础上使用内部互斥锁和条件变量来控制并发以达到线程安全的目的,其主要用于 [生产者-消费者] 队列.1.BlockingQueue初始化时会确定队列容量(_capacity),如果队列已满(capacity=0),则会阻塞enqueue操作.2.关闭BlockingQueue(调用queue_free)是一个延迟的操作,它会等待所有元素都dequeue,期间,该队列的一切enqueue操作将无效.3.此代码未经生产环境检验,仅供学习参考.BlockingQueue.h#ifndef CUR_BLOCKINGQUEUE_H#define 阅读全文
posted @ 2013-12-31 13:48 liheping 阅读(1015) 评论(0) 推荐(0)
摘要:简单的FIFO队列实现,非线程安全!1.queue.h :abstract data type queue#ifndef CUR_QUEUE_H#define CUR_QUEUE_H#includestruct node{ int value; struct node * next;};typedef struct queue{ int max,cur; struct node * head, * tail;}queue;extern queue* empty_queue(int _max);extern int queue_free(queue *q);exter... 阅读全文
posted @ 2013-12-30 16:46 liheping 阅读(830) 评论(0) 推荐(0)
摘要:过程记录 :1.下载gsoap_2.8.17.zip 并 解压 :$unzip gsoap_2.8.17.zip2.进入解压后的目录gsoap-2.83.自动配置编译环境: $./configure –prefix=$(pwd)/_install配置失败原因:error: C++ compiler cannot create executables解决办法:You need to install c++ on your computer. even if you installed gcc that doesn’t automatically install g++. Try to run o 阅读全文
posted @ 2013-12-26 14:17 liheping 阅读(5689) 评论(0) 推荐(0)