20 likes | 104 Views
http://xcybercloud.blogspot.com/2009/01/asychronous-io-model-on-windows.html.
E N D
http://xcybercloud.blogspot.com/2009/01/asychronous-io-model-on-windows.htmlhttp://xcybercloud.blogspot.com/2009/01/asychronous-io-model-on-windows.html - Multi-threading is supported through thread library- I/O multiplexing is supported by select(), WSAAsyncSelect(), WSAEventSelect()- Async Polling/Async Waiting is supported by means of Overlapped I/O- Async Callback model is supported by means of Alertable I/O- Async Queuing is supported by means of I/O Completion Port
- Scalable Asynchronous I/O Models In Async Model, I/O operation call returns immediately after being issued and code that follows will get executed. The various models differs only on how to get I/Ocompletion notification:1. Polling - Use various polling function (such asHasOverlappedIoCompleted() on Windows) to poll whether some pending Async I/O is completed2. Callback - Kernel will call some user provided call back functions when some i/o operations are completed.3. Waiting - The OS kernel will signal some kernel event objects when i/o operations are completed. Application code just waits on these events to get completion notification.4. Queuing - Kernel will place some information packet into a Queue (such as I/O Completion Port on Windows) when I/O operations completed. Client code should check that Queue for completion information.Another advantage of Async I/O is that it reduces memory copy cost. Other I/O models need copy data(for send/receive) in system buffer from/to application buffer. In Async I/O, system knows the receiving/sending buffer when the io request is issued, so I can use it directly, no need to do memory copy between system space and user space.