2015年9月8日

xpool, cpool,epoo

摘要: 是很经典的领导者追随者模型,因为不想命名太长,就叫xpool。多个工作线程同时accept竞争一个可用的连接,拿到连接后就自己进行处理。accept这个地方加了锁是为了避免低版本内核上出现惊群效应. 一般认为在短连接的时候效果比较好,但如果同一时候连接数过多会造成没有工作线程与客户端进行连接,客户端... 阅读全文

posted @ 2015-09-08 11:44 月未央 阅读(818) 评论(0) 推荐(0)

pthread_create,pthread_once,pthread_key_create,pthread_key_delete,pthread_getspecific,pthread_setspecific()

摘要: pthread_create是UNIX环境创建线程函数头文件 #include函数声明 int pthread_create(pthread_t*restrict tidp,const pthread_attr_t *restrict_attr,void*(*start_rtn)(void*),... 阅读全文

posted @ 2015-09-08 11:36 月未央 阅读(948) 评论(0) 推荐(0)

导航