From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-08-2008 04:35 AM
01-08-2008 11:27 AM
Hi
crazyfwed,
Without looking into the source directly I can only provide you with a theoretical
reason as to the behavior you are seeing. Hopefully this answer will
satisfy your curiosity.
Essentially PostDeferredCall tells CVI to call a specific function the next
time CVI processes events. Now it’s important to understand that we try to
be "smart" in terms of how often pump messages. By that I
mean in certain parts of our message pump code, we make calls into the Win32
Sleep() function. How often we call Sleep or when we call Sleep is dependent
upon what you have set as your sleep policy. When I said we are being
"smart", I meant that if for example, we see that system events are
being fired, we will go ahead and start pumping messages. Since the call to PostDeferredCall is on the queue, we will go ahead and address that call (i.e. by calling the function you specified).
Now the reason I stated that is because I believe what is happening is that
when you move your mouse around, system events are being fired and thus we are
going to be pumping messages. This in turn means that we will call your
function. Now, when you are not moving the mouse, there is little to no events
being fired and thus we don't pump messages as often.
You could try out my theoretical
thoughts be setting the Sleep policy to do not
sleep and observing if you see the same behavior in both cases of moving and not moving your mouse. You can set the sleep policy in CVI
under Options >> Environment and then selecting an option in
the CVI environment sleep policy field.
Hope this helps!
Best Regards,
01-23-2008 03:19 AM
01-23-2008 01:13 PM
02-20-2008 05:50 AM
02-21-2008 12:07 AM
Satyam,
After PostDeferredCallToThread(), you need to call CmtWaitForThreadPoolFunctionCompletion(). Remember to then call CmtReleaseThreadPoolFunctionID().
You will find further information in the function help.
Regards,
Colin.