http://zhidao.baidu.com/link?url=UVTXeK4ncKmnwatGUW2deMFylNYBuur-zHmK3w53NXNRpgPbhld2WdkMD766nKl_6HjtW3t0tyB5kzFaQDHxha 

On Linux, select() modifies timeout to reflect the amount of time not slept; most other implementations do not do this. (POSIX.1-2001 permits either behavior.) 
This causes problems both when Linux code which reads timeout is ported to other operating systems, and when code is ported to Linux that reuses a struct timeval
for multiple select()s in a loop without reinitializing it. Consider timeout to be undefined after select() returns. linux在select调用之后会修改timeout值为无sleep的时间。所以第一次select是sleep了timeout设定的时间,然后timeout就被修改为0了(因为全部时间都在sleep,无sleep为0)。
在循环内调用第二次开始就有问题。

最新文章

  1. ORA-01157 & ORA-01110
  2. Q的深层嵌套
  3. 用powershell批量新增user profile
  4. Spring webapp - shutting down threads on Application stop
  5. 修改Django的默认打印时间
  6. 设计模式 --- 模型-视图-控制器(Model View Controller)
  7. dwr使用步骤
  8. linux下安装配置DHCP服务器
  9. 个人博客设计:创建Sql数据库操作类。
  10. 查看mysql字符集及修改表结构--表字符集,字段字符集
  11. iOS6和iOS7代码的适配(1)
  12. BootStrap 智能表单系列 八 表单配置json详解
  13. If We Were a Child Again
  14. [Ext JS 4] 实战之 Picker 和 Picker Field
  15. stdafx文件介绍
  16. WeQuant交易策略—5日均线
  17. Lintcode: Knight Shortest Path
  18. Eureka客户端注册多网卡下IP选择问题
  19. Golang的聊天服务器实践(群聊,广播)(一)
  20. LabVIEW版本控制(转)

热门文章

  1. C++中的栈内存和堆内存的区别
  2. multi thread for Java
  3. spring 整合 Struts1.X [转]
  4. html template & iframe
  5. js小功能记录
  6. TFS(Team Foundation Server) 权限设置记录
  7. activiti教程之示例项目activiti-explorer运行_百度经验
  8. laravel 实用扩展包
  9. 读论文Machine Learning for Improved Diagnosis and Prognosis in Healthcare
  10. 详解 Cookie 纪要(vue.cookie,jquery.cookie简化)