dcsimg

Using a Non-Blocking Versions of Win32 Wait Functions

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame


Environment: VC6, NT4/2000/XP

Current implementations of the Win32 wait functions—such as Sleep(), WaitForSingleObject(), and WaitForMultipleObjects()—will block the message pump when called on a window thread. A special case of this is a thread that calls CoInitialize(), resulting in potentially blocking COM method calls to an object. The attached code is a MS VC++ static library project that caters to this problem by using MsgWaitForMultipleObjects to rewrite the functions such that if there are pending messages in the message queue, they are processed during the wait.

Downloads

Download source - 3.28 Kb


Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date