- 论坛徽章:
- 0
|
请问各位大侠
磁盘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 的慢系统调用如果被信号中断,是不是默认自动重新启动的?
还用得着象下边这样写吗?
- again:
- connfd = accept(listenfd,blog);
- if (connfd < 0 && errno == EINTR){
- goto again;
- }
复制代码 |
|