贝贝花花包包店,精品555皮具,钱夹,皮夹

字体:  

what's the difference between async i/o (or socket)and non block i/o

peakzhang 发表于: 2008-9-21 15:06 来源: ACE 开发者

They are very different, as follows:
. AIO is "asynchronous I/O", i.e., the operation is invoked
  asynchronously and control returns to the client while the OS kernel
  processes the I/O request.  When the operation completes there is
  some mechanism for the client to retrieve the results.
. Non-blocking I/O tries an operation (such as a read() or write())
  and if it the operation would block (e.g., due to flow control on a
  TCP connection or due to lack of data in a socket), the call returns
  -1 and sets errno to EWOULDBLOCK.
Dr. Douglas C. Schmidt