LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Processor Time taken by threads

I have an application in which the main thread of the application calls the RunUserInterface, whereas another thread does the update of all the controls in the screen periodically.  On analysis of the processor time utilised by the application, I am finding that, with just the periodic update of screen, the main thread takes more than 80% of the processor time out of the total time taken by the application/process.  Is this an expected behaviour of Labwindows?  My expection is that the thread on which update is done should take the maximum process time.  And that's how I want it.  Can someone comment on this? 

 

 

0 Kudos
Message 1 of 3
(4,199 Views)

Ideally, a user interface program just sitting in RunUserInterface should take almost no processor time, since it is just ready for getting events. This situation can vary notably if the application has some task running like a UI timer that is periodically performing some operations. The situation can also be influenced by the CVI environment sleep policy that you can set in Options >> Environment window: Sleep Some is usually a good option for the user interface thread.

How much processor time does your program consume if you cut out data acquisition and display process?

And how are you calculating threads time? Are you using the execution profiler toolkit?



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?
Message 2 of 3
(4,179 Views)
Thanks for the reply. There are no UIR timers. I have tried with all sleep policies which doesn't seems to be relavent to the problem I face. I have a thread which receives data on LAN, process it and pass the data to another waiting thread. The waiting thread(UpdateThread) updates the User interface making use of the received data. In this process, I expect, whatever the processing done to update the screens is done by the UpdateThread and not the main thread which is simply waiting on RunUserInterface. However, my observation using 'Performance Monitor'(Windows application) of the Thread process time shows activity(more process time) in the main thread with very little process time in the UpdateThread. I have ensured that no other functions other than this is active.
0 Kudos
Message 3 of 3
(4,171 Views)