IO同步,异步,阻塞,非阻塞.docVIP

  • 2
  • 0
  • 约3.34千字
  • 约 5页
  • 2016-12-11 发布于重庆
  • 举报
同步(synchronous) IO和异步(asynchronous) IO,阻塞(blocking) IO和非阻塞(non-blocking)IO 先看一个较低的层次。如果从CPU的角度看,其实大部分的IO都是异步的:因为CPU启动这个IO操作后,就去干其它的事情了,一直到产生一个中断,告诉它IO完成了。 “Most physical I/O is asynchronous—the CPU starts the transfer and goes off to do something else until the interrupt arrives. User programs are much easier to write if the I/O operations are blocking—after a read system call the program is automatically suspended until the data are available in the buffer. It is up to the operating system to make operations that are actually interrupt-driven look blocking to the user programs.” (引自 Modern

文档评论(0)

1亿VIP精品文档

相关文档