Overlapped I/O
From Wikipedia, the free encyclopedia
In Microsoft Windows programming, Overlapped I/O is a feature of the application programming interfaces for file operations, introduced by Windows NT. For asynchronous reads and writes, one may pass a special OVERLAPPED structure to the ReadFile(), WriteFile(), and similar functions (such as the Winsock API calls WSASend()/WSARecv()), and the operation will be completed later. Optionally, you may 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 files or sockets.
A possible Unix analogue to the overlapped I/O concept would be non-blocking file descriptors. However, these would require significant restructuring of code to get the same result, as the Unix code would have to repeatedly retry the operation. Another possibility would be the POSIX asynchronous I/O API, however it is not universally supported.
Overlapped I/O is particularly useful for sockets and pipes. It is not well supported by Windows 95, 98 or ME.