标签:
http://blog.csdn.net/horstlinux/article/details/7911457
http://blog.csdn.net/eroswang/article/details/2932630
在linux下调用sleep是用时钟的,一个进程的时钟系统是有限制的.如果每个线程使用sleep,到了最大的数量,最终会进程会挂起.最好是用select取代
void select_sleep(int i)
{
struct timeval timeout;
timeout.tv_sec = i;
timeout.tv_usec = 0;
select( 0, NULL, NULL, NULL, & timeout );
}
标签:
原文地址:http://www.cnblogs.com/okgogo2000/p/4491847.html