NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand "intriguing" behavior

Hi All, I would appreciate to have your comments about a problem I have with my TS application. One of my customer use TestStand engine to start a sequence (via an external operator interface). This sequence has 2 threads : - main thread with priority +2 = HIGH, - other thread with priority -2 = LOW (it send data to main thread every minute). This application is used for many months but lately the customer was face to an "intriguing" behavior. After more than 20 hours without any problems, when the operator came to verify the test : - main thread seems suspended, - other thread was still OK. (customer saw that using a trace report) As soon as he touched the mouse the main thread worked correctly. Then few minutes after, it suspended again, ... Note that when I specify "suspended" it means that the thread "didn't do his job", I can't specify if the thread was suspended TS speaking. Equipment used : - TestStand 2.0.1 - Windows 2K (5.00.2195) - Service pack 4 - Intel pentium 4 CPU 3GHz - 1 Go RAM These are all information I have ... Have you met this problem? any suggestion ? THX Guillaume
0 Kudos
Message 1 of 6
(4,187 Views)
Sounds like it might be a thread priority problem. A lower priority thread can be starved if there is a higher priority thread that does not periodically sleep or suspend waiting for an event. A higher priority thread can also be blocked if it waits for a signal from a starved thread.
 
Moving the mouse can give a thread a dynamic priority boost which could delay the occurrence of the starvation.
 
You might try calling
 
BOOL WINAPI SetProcessPriorityBoost(
  HANDLE hProcess,
  BOOL DisablePriorityBoost
);
to disable priority boosting to make the underlying problem easier to reproduce.
 
Also, here is a warning from MSDN about using the high priority setting:
 
Use HIGH_PRIORITY_CLASS with care. If a thread runs at the highest priority level for extended periods, other threads in the system will not get processor time. If several threads are set at high priority at the same time, the threads lose their effectiveness. The high-priority class should be reserved for threads that must respond to time-critical events. If your application performs one task that requires the high-priority class while the rest of its tasks are normal priority, use SetPriorityClass to raise the priority class of the application temporarily; then reduce it after the time-critical task has been completed. Another strategy is to create a high-priority process that has all of its threads blocked most of the time, awakening threads only when critical tasks are needed. The important point is that a high-priority thread should execute for a brief time, and only when it has time-critical work to perform.
0 Kudos
Message 2 of 6
(4,174 Views)
Thanks for you reply.

The 2 threads are independants. Firts trhead, the main one with the higher priority :
- start the second one
- do its work during 36hours
- stops second thread just before leaving application.

There are no synchronisations between the threads (no queues, events, ...). So, according to me, neither the main or the second thread could be starved.
I think that your explanation about priority problem could be OK but the fact that the second thread (with a lower priority) still working correctly annoyed me.

BR.


0 Kudos
Message 3 of 6
(4,154 Views)
Hi
Very strange behavior!
Do you have an example code showing the problem?
What are doing your threads exactly? Do you have tested in another computer?

Kamal
NI France




0 Kudos
Message 4 of 6
(4,140 Views)
Was there any solution to the above problem?
We have the same kind of problem where the application runs fine until 30min or 1 hour and the UI thread goes to freeze state. After that, when we come back and move the mouse, the application seems to go from a freezing state to non freezing state.  Some VIs with higher priority run fine.  Any ideas?
 
0 Kudos
Message 5 of 6
(3,865 Views)

Hi Jaggs1 ,

Can u give me your application? In order to make some tests.

Thanks.

Nacer Mokhtari.

Nacer M. | Certified LabVIEW Architecte

0 Kudos
Message 6 of 6
(3,814 Views)