LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

If I am having 1 sec timer calling a fucntion,my function will take 2sec to return what will happen?

Spoiler
Spoiler
CallbackTimer()//1 sec Timer
{
  Dosomework();//it will take 2 sec to complete
}
0 Kudos
Message 1 of 2
(2,726 Views)

The timer callback will be called immediately after returning; the system will be somewhat hung (i.e. it will be possible to interact with it but with significative delays since the OS will have very little time to serve user events).

 

In such a case, some redesign of the application is needed: for example, it is difficult to imagine you have a function the is busy all that time, there may be some pauses or waits in it. In such a case, passing to a multithreaded approach will grant the system will be able to handle UI and other events during waits in the second thread.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,703 Views)