随笔分类 -  线程进程

ps:分钟级监控服务内存变化情况
摘要:相关:http://www.cnblogs.com/peida/archive/2012/12/19/2824418.html monitor.sh */1 * * * * sh monitor.sh >/dev/null 2>&1 ps命令:process status的缩写。ps命令用来列出系统 阅读全文

posted @ 2017-09-06 15:35 月未央 阅读(250) 评论(0) 推荐(0)

pthread_create、pthread_join
摘要:1、pthread_create:创建线程; 2、pthread_join:等待线程结束; pthead_create(a,..); pthread_join(); pthead_create(b); ... 则线程a执行完毕后,才会开始创建运行线程b; 阅读全文

posted @ 2017-08-21 19:39 月未央 阅读(631) 评论(0) 推荐(0)

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

posted @ 2015-09-08 11:44 月未央 阅读(827) 评论(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 月未央 阅读(963) 评论(0) 推荐(0)

signal(SIGPIPE, SIG_IGN)
摘要:转自http://blog.163.com/niuxiangshan@126/blog/static/170596595201221942952676/当服务器close一个连接时,若client端接着发数据。根据TCP 协议的规定,会收到一个RST响应,client再往这个服务器发送数据时,系统会... 阅读全文

posted @ 2015-08-05 09:47 月未央 阅读(4574) 评论(0) 推荐(0)

导航