Concurrent I/O Request Flow
 
The movement of multiple driver I/O requests from clients through the Device Manager to concurrent drivers and back again follows these steps:
- 
 
A client issues an I/O request.
 
- 
 
The request (in the form of an I/O parameter block) is passed to the Device Manager.
 
- 
 
The Device Manager uses the 
refNum
 in the I/O parameter block to locate the appropriate driver.
 
- 
 
The Device Manager checks the 
kdriverQueuesIOPB
 option bit. If the value of the bit is 
false, the Device Manager adds the I/O parameter block to the driver's DCE-based request queue.
 
- 
 
The Device Manager invokes the driver's 
DoDriverIO
 entry point.
 
- 
 
The driver may choose to leave the request on the DCE queue; alternately, if it is using the 
kdriverQueuesIOPB
 bit, the driver may put the request into a privately managed queue.
 
- 
 
The driver starts the I/O action; if it is truly asynchronous, it returns to the Device Manager without calling 
IOCommandIsComplete.
 
- 
 
If the client issued the request synchronously, the Device Manager waits for the completion of the request; otherwise, it returns control to the client.
 
- 
 
Some time later, the driver determines (through a hardware or secondary interrupt routine) that the device I/O action has finished. At this time, the driver scans its private queue looking for the I/O parameter block representing the I/O action.
 
- 
 
The driver uses the I/O parameter block 
commandID
 stored at (
ThePb
 -> 
ioParam.ioCmdAddr
) to issue an 
IOCommandIsComplete
 call. Drivers using the 
kdriverQueuesIOPB
 bit must make sure the I/O parameter block is not on any queue when calling 
IOCommandIsComplete.
 
- 
 
The Device Manager places the result in the I/O parameter block.
 
- 
 
If the I/O request was issued synchronously, control returns to the client. If the I/O request was issued asynchronously, the Device Manager invokes the client's completion routine (if one exists).
 
- 
 
Control returns to the driver. The driver should not attempt to access the I/O parameter block after calling 
IOCommandIsComplete.
 
 
© 1999 Apple Computer, Inc.  (Last Updated 26 March 99)