Overlapped I/O from wikipedia

 

 

Overlapped I/O is an asynchronous I/O extension of the Windows APIs, which was introduced in Windows NT.
Utilizing overlapped I/O requires passing an OVERLAPPED structure to API functions that normally block, including  Winsock WSASend() and WSARecv().
The requested operation is initiated by a function call which returns immediately, and is completed by the OS in the background.
The caller may optionally specify a Win32 event handle to be raised when the operation completes.
Alternatively, a program may receive notification of an event via an I/O completion port, which is the preferred method of receiving notification when used in symmetric multiprocessing environments or when handling I/O on a large number of  sockets.
Overlapped I/O is particularly useful for sockets . It is not well supported in Windows 9x.
The Unix equivalent of overlapped I/O is the POSIX asynchronous I/O API (AIO).

 

Overlapped I/O 是Windows API的一个异步I/O操作的拓展.在Windows NT中被引入.
使用Overlapped I/O 需要传递一个 OVERLAPPED structure 到 创建socket 参数中,以及Winsock WSASend() and WSARecv() 函数中.
被OVERLAPPED struct 初始化的WSASend() and WSARecv() 函数调用时,会立刻返回.并且通过操作系统在背后完成.
函数调用者可以指定一个Win32 Event Handle  解决 I/O 操作完成时的事件.
程序也可以通过完成端口来接收到一个I/O操作完成的通知.当在一个多核系统中处理大量socket事件通过I/O完成端口来接收I/O操作完成事件是首先选择的方法.
Overlapped I/O 对于Socket特别有用途.但是在windows 9x中支持的不是很好.
在Unix系统中, The POSIX asychronous I/O (AIO) 和Overlapped I/O功能差不多.

 

小结: Overlapped I/O 实质上就是一种异步I/O模型,在Unix 系统中为AIO模型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值