03-29-2005 09:48 AM
When I was having thruput problems on my hardware, I started removing my threads one-by-one.
However, when I was down to minimal number of application threads, I was still getting threads that would not go away.
(1) main thread.
(2)OpenComConfig() caused a thread to appear?
(3) select a menu, opened two(2) threads?
(4) RunUserInterface() opened a thread?
When the minimal two application threads were running, TaskManager still indicated 4 unknown threads running (+1 main thread).
Is there a way to remove these threads? Or do I need them for my CVI application?
Do I need to add ProcessSystemEvents() all over my threads, or will the compiled code automatically round-robin my threads?
03-29-2005 10:06 AM
03-29-2005 11:16 PM
03-30-2005 09:45 AM
void thread1Hz_notWorking()
{
~~~WaitForSingleObject(halt_event,1000)
~~~{
~~~~~~// do processing about 100msec
~~~~~~// do processing about 100msec
~~~}
}
void thread_Half_Hz()
{
~~~WaitForSingleObject(halt_event,2000)
~~~{
~~~~~~SetCtrlVal(panel, led_control, 1 );
~~~~~~// do processing
~~~~~~SetCtrlVal(panel, led_control, 0 );
~~}
}
void thread1Hz_working()
{
~~~WaitForSingleObject(halt_event,1000)
~~~{
~~~~~~// do processing about 100msec
~~~~~~ProcessSystemEvents();
~~~~~~// do processing about 100msec
~~~~~~ProcessSystemEvents();
~~~}
}
So if the CVI threads are not interfering my same-priority-threading scheme, why is the LED not blinking at 1/2 Hz, until I put ProcessSystemEvents() into the 1Hz thread? Is there another solution I am missing?
Thanks.
03-30-2005 10:17 AM
03-30-2005 04:43 PM