Windows System Programming Third Edition [Electronic resources]

Johnson M. Hart

نسخه متنی -صفحه : 291/ 207
نمايش فراداده

  • Chapter 14. Asynchronous Input/Output and Completion Ports

    Input and output are inherently slow compared with other processing. This slowness is due to factors such as:

    • Delays caused by track and sector seek time on random access devices (such as discs and CD-ROMs)

    • Delays caused by the relatively slow data transfer rate between a physical device and system memory

    • Delays in network data transfer using file servers, storage area networks, and so on

    All I/O in previous examples has been thread-synchronous, so that the entire thread waits until the I/O operation completes.

    This chapter shows how a thread can continue without waiting for an operation to completethat is, threads can perform asynchronous I/O. Examples illustrate the different techniques available in Windows.

    Waitable timers, which require some of the same techniques, are also described here.

    Finally, and more importantly, once standard asynchronous I/O is understood, we are in a position to use I/O completion ports, which are extremely useful when building scalable servers that must be able to support large numbers of clients without creating a thread for each client. Program 14-4 modifies an earlier server to exploit I/O completion ports.