LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Headless Application?

To mvr:  Thank you for the additional information.  Because of the nature of this application, I am concerned with maximum performance in other threads.
 
Blocking in the main thread would not be a problem for this headless app, since the quit callback is called there and obvously no panel updates.  However, I had planned to put two TSQ callbacks in the main thread, thinking that would be efficient.  Sounds like I either need to do the main thread like Menchar suggested (use RunUserInteface with a blank panel), or put the TSQ callbacks into the threads with their TSQ writers.
0 Kudos
Message 11 of 13
(1,051 Views)
The topic of the Delay function comes up fairly regularly, and if you search the forum you can probably find some useful information. Hopefully there isn't inconsistent information -- at least I didn't find any, but I didn't do an exhaustive search.

To summarize: the Delay function definitely does not process events. So your callbacks will not be called in the thread that is delayed.
As for the "busy wait" issue, it's not easy to categorize. I can't say that it's a busy wait, since for most of the duration of the delay, the thread really is sleeping. But it also executes some code periodically that causes it to use more processor time than if you had called the Sleep function. So, it's not purely sleeping either.

Hope this clarifies it some.

Luis
NI
0 Kudos
Message 12 of 13
(1,027 Views)

Well Delay() causes my CPU usage to hit 100% (according to Task Manager), which is pretty busy in my bookSmiley Wink

JR

0 Kudos
Message 13 of 13
(1,020 Views)