LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

when makes "SetSleepPolicy" sense?

Hallo everybody,

Has anybody made experiences with the function "SetSleepPolicy()" ?
From which number of parallel working threads could it be useful?

thx
Florian
0 Kudos
Message 1 of 3
(3,395 Views)
The sleep policy controls how much sleep time the RunUserInterface message loop takes. Settings the to "Do not sleep" will result in CVI processing messages as fast as possible, but this results in the CVI app taking up more CPU time. So if you want to ensure that your CVI app processes all the messages ASAP, you could change this setting and this would make your app "feel" faster but your CPU usage will go up.
In most cases, you should not need to change this setting to get more responsiveness from an application. Designing an application to run in a concurrent fashion (multiple threads for multiple tasks) should be the way to go. But it's hard for me to pinpoint how many threads becuase this is very application and machine dependant, especially with dual core systems and hyperthreading now becoming avalable to the masses. It is best to experiment with your application and see what works best with you.

Here is another document that talks about optimizing your CVI application. I hope this helps.
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,376 Views)
thx it helps.
till now it works correct with the multiple threads ...

Florian
0 Kudos
Message 3 of 3
(3,374 Views)