The reason for increase in speed in the thread that is calculating and drawing data is because when you hold up the other thread (i.e. by pressing down on the mouse button over the listbox , the first thread gets all the processor time and therefore runs faster. The reason why the main thread waits is because of the ProcessSystemEvents() function. This will wait on the release of that mouse button and therefore hold up the entire thread. Basically, if you have a thread that is doing all the work (i.e. lots of calculations and sending data to a chart) then it should have a higher priority than other threads that may be only checking events from the user. In order to set a higher priority to another you can use the SetAttribute function found in the CVI Library>>Util
ity>>Multithreading>>
ThreadPool>>Advanced Functions>>Set Attribute. You can also effectively set the priority of a thread by putting the thread to sleep using SleepEx (windows function, check out MSDN) function or the SetSleepPolicy (CVI Function, look at CVI help).
Buddy Curtis
Applications Engineer
National Instruments
Joji