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 3: Call a Function When a Single Kernel Object Becomes Signaled

Microsoft discovered that many applications spawn threads simply to wait for a kernel object to become signaled. Once the object is signaled, the thread posts some sort of notification to another thread and then loops back, waiting for the object to signal again. This is exactly the scenario you saw earlier in the Batch example, where a dedicated work item was needed to monitor when the real actions were finished by waiting for kernel events signaled when each real action callback ended. Some developers even write code in which several threads wait on a single object. This is incredibly wasteful of system resources. Sure, there is a lot less overhead involved in creating ...

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