
进程-线程
文章平均质量分 77
yingsun
坚持下去~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
简单的thread_pool代码
#include#include#include#include#define DEFAULT_THREAD_NUM 4typedef struct job_s { void *(*process)(void*); void *arg; struct job_s *next;}job_t;typedef struct thread_pool_s {原创 2013-04-22 21:21:27 · 1212 阅读 · 0 评论 -
生产者消费者
#include#include#include#include#include#include#include#include#define BSIZE 10typedef struct buffer_s { char buf[BSIZE]; int occupied; int nextin; int nextout; pthread原创 2013-04-25 21:10:47 · 1141 阅读 · 0 评论 -
pthread_cond_wait详解
通常,和pthread _cond_wait 配对使用的有pthread_cond_signal , 同时还有用于pthread_cond_t初始化的pthread_cond_init,销毁的pthread_cond_destroy函数,还有用于加锁保护的pthread_mutex_lock和pthread_mutex_unlock,稍后会对为什么进行加锁做解释。 初始化条件变量int原创 2013-04-21 11:12:11 · 26416 阅读 · 4 评论