I have just been investigating a similar problem. I have a data acquisition app which has three threads: one for HMI, one for data acquisition and one for data processing. During a data capture run, both the data acquisition and data processing threads are 'busy' threads - they have some Sleep(0) calls, but otherwise are busy all the time, checking to see if data is available and then processing it.
This app works fine on most PCs but one customer was having difficulty - the data acquisition thread reported that it was running out of time to do its stuff. On investigation, I found that, on my customer's PC, that particular thread was getting hardly any processing time even though all threads run at the same priority.
I found I could cure the problem by putting the b
usy threads to sleep on a regular basis for a non-zero amount of time. I used Sleep(5), because I couldn't afford to let them go to sleep for a long time.
Paradoxically, putting these non-zero Sleep() calls into the threads resulted in Windows giving them
more time than they had previously.
So, I don't know if that story will help you at all but I would be interested to know if it does! Also if anyone else knows why Windows exhibits this peculiar behaviour.
--
Martin
--
Martin
Certified CVI Developer