Overlapped I/O

What’s overlapped I/O?  You may have noticed that functions like ReadFile, WriteFile and DeviceIoControl (and some others) have a parameter which is a pointer to a OVERLAPPED struct which in Windows CE is unused: in big Windows the I/O Manager handles I/O requests creating I/O Request Packets (IRP) which are sent to the device drivers. These IRP’s can be handles synchronously or not. In Windows CE the device manager acts -to some extent- as the I/O Manager but -until WEC7- only in a synchronous way: this means that when your application calls, for example,  ReadFile the request goes through the DM which calls the XXX_Read function in the driver and gives control back to the application only when the XXX_Read terminates: everything occurs synchronously. Overlapped I/O, on the other side, works differently: it’s typically -and appropriately- called asynchronous I/O because, under some conditions, if you pass a pointer to an OVERLAPPED structure to the ReadFile, the function can return immediatly leaving the device driver perform its work. The application will be signalled later when the I/O operation has actually completed. We will talk about this deeply in the next posts. For an overview of overlapped I/O in Windows I suggest reading the MSDN documentation http://msdn.microsoft.com/en-us/library/ms686358(v=vs.85).aspx

This entry was posted in Windows Embedded CE and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s