select 函数小结 -- 转自百度知道
2024-10-19 04:32:36
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)。
在循环内调用第二次开始就有问题。
最新文章
- ORA-01157 &; ORA-01110
- Q的深层嵌套
- 用powershell批量新增user profile
- Spring webapp - shutting down threads on Application stop
- 修改Django的默认打印时间
- 设计模式 --- 模型-视图-控制器(Model View Controller)
- dwr使用步骤
- linux下安装配置DHCP服务器
- 个人博客设计:创建Sql数据库操作类。
- 查看mysql字符集及修改表结构--表字符集,字段字符集
- iOS6和iOS7代码的适配(1)
- BootStrap 智能表单系列 八 表单配置json详解
- If We Were a Child Again
- [Ext JS 4] 实战之 Picker 和 Picker Field
- stdafx文件介绍
- WeQuant交易策略—5日均线
- Lintcode: Knight Shortest Path
- Eureka客户端注册多网卡下IP选择问题
- Golang的聊天服务器实践(群聊,广播)(一)
- LabVIEW版本控制(转)
热门文章
- C++中的栈内存和堆内存的区别
- multi thread for Java
- spring 整合 Struts1.X [转]
- html template &; iframe
- js小功能记录
- TFS(Team Foundation Server) 权限设置记录
- activiti教程之示例项目activiti-explorer运行_百度经验
- laravel 实用扩展包
- 读论文Machine Learning for Improved Diagnosis and Prognosis in Healthcare
- 详解 Cookie 纪要(vue.cookie,jquery.cookie简化)