O'Reilly logo

Windows® via C/C++, Fifth Edition by Christophe Nasarre, Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scenario 4: Call a Function When Asynchronous I/O Requests Complete

In Chapter 10, I talked about how to perform asynchronous I/O operations efficiently using the Windows I/O completion port. In that chapter, I explained how you could create a thread pool where the threads wait on the I/O completion port. Fortunately, the thread pool being discussed throughout this chapter manages the creation and destruction of threads for you, and these threads internally wait on an I/O completion port. However, when you open a file or device, you must associate the file/device with the thread pool’s I/O completion port. Then you must tell the thread pool which function of yours to invoke when the asynchronous I/O operations you make of the file/device complete. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required