1.2.7  Supporting Asynchronous I/O

The I/O Manager provides asynchronous I/O support so that the originator of an I/O request (usually a user-mode application, but sometimes another driver) can continue executing, rather than waiting for its I/O request to be completed. Providing asynchronous I/O support improves overall system I/O throughput, as well as the performance of any code that makes an I/O request.

As a consequence, NT drivers do not necessarily process I/O requests in the same order they were sent to the I/O Manager. The I/O Manager or a higher-level driver can reorder I/O requests as they are received or can split a large data transfer request into smaller transfer requests. Moreover, an NT driver can overlap I/O request processing, particularly in a symmetric multiprocessor platform, as mentioned in Section 1.2.4.

Note that an NT driver’s processing of a given I/O request is not necessarily serialized. That is, an NT driver does not process each IRP to completion before it starts processing the next request, as drivers naturally do in a single-tasking operating system written to support synchronous I/O in uniprocessor machines.

Instead, NT drivers respond to the current IRP as it is passed to the driver’s standard routines by carrying out whatever routine-specific operations are necessary to satisfy the current request. However, a lowest-level NT driver is required to help the I/O Manager and any higher-level drivers processing the same IRPs to track the status of each request by setting the I/O status block in the IRP.

NT drivers also can maintain state information about their current I/O operations in a special part of their device objects, called a device extension.

For an overview of IRP processing and of how device objects represent the physical and logical devices of NT drivers, see Chapter 2. For more detailed information about device objects and device extensions, see Chapter 3.