免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1878 | 回复: 2
打印 上一主题 下一主题

[C] linux慢系统调用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-20 11:18 |只看该作者 |倒序浏览
请问各位大侠

磁盘I/O 是慢系统调用吗?APUE上这句话不知道怎么理解:
The notable exception to these slow system calls is anything related to disk I/O. Although a read or a write of a disk file can block the caller temporarily (while the disk driver queues the request and then the request is executed), unless a hardware error occurs, the I/O operation always returns and unblocks the caller quickly.

是理解成 磁盘I/O不是系统调用,因为虽然他们会暂时阻塞一下调用,但是会很快返回
还是理解为:
磁盘I/O 是系统调用,但是并不是象其他系统调用那样会永远阻塞调用者,只会暂时阻塞一下。

还有就是linux 2.6 的慢系统调用如果被信号中断,是不是默认自动重新启动的?
还用得着象下边这样写吗?



  1. again:
  2.     connfd = accept(listenfd,blog);
  3.       if (connfd < 0  && errno == EINTR){
  4.           goto again;
  5.           }

复制代码

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
2 [报告]
发表于 2009-03-20 11:32 |只看该作者
原帖由 wliang511 于 2009-3-20 11:18 发表
磁盘I/O 是慢系统调用吗?APUE上这句话不知道怎么理解:
The notable exception to these slow system calls is anything related to disk I/O. Although a read or a write of a disk file can block the caller temporarily (while the disk driver queues the request and then the request is executed), unless a hardware error occurs, the I/O operation always returns and unblocks the caller quickly.

这就是说 disk I/O 相关的 system call 只会暂时阻塞调用者。

论坛徽章:
0
3 [报告]
发表于 2009-03-20 12:17 |只看该作者
我问的是。。是不是慢系统调用,还有下边那个问题。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP