Asynchronous vs. synchronous mode
Although the driver can be used in synchronous (FILE_ATTRIBUTE_NORMAL in CreateFile)
or asynchronous (FILE_FLAG_OVERLAPPED) mode. It is not recommended to use the
synchronous mode as it has an serious disadvantage.
Every request to the driver (WriteFile,
ReadFile, DeviceIoControl)
must finish, before the next request can be processed.
This means, if you have a ReadFile pending
(waiting for data packets) you cannot deinit the driver or execute a WriteFile.
Also cancelling the pending request via CancelIo is not possible!
This is the main reason, why you should (in most cases) use the asynchronous
mode. The asynchronous mode causes little more programming overhead, but
enables you, to take advantage of having several requests running at the
same time.
The asynchronous mode can be split in 2 more modes:
For a more detailed information please consult the manuals of your compiler manuals or the SDK from Microsoft (see MSDN Library).
Back to Programming Guide | Contact | Copyright and Disclaimer |