12-29-2013 10:56 AM
Thread setup takes too long.
I have a summing loop that I divided into multiple threads. But it took 30 milli-secs to get the threads started. I could do the whole loop in a single for() in much less time. I followed the NI example almost exactly. Setting the priority made almost no difference. Does something in a Windows7/8 setting need fixing?
tx
Matt
12-29-2013 01:41 PM
Hello scudieremb,
What version of LabWindows/CVI are you using? Are you noticing a slowdown compared to another OS, or to another runtime?
Best regards,
= Nelu F. || National Instruments.
12-30-2013 02:35 AM
In order to avoid the overhead of starting the threads in the exact moment you need them, you could try an alternative approach based on thread safe queues: see this help page
At program start you can create threads and thread safe queues, next in the thread callback simply setup the callback associated to the thread queue with CmtInstallTSQCallback and wait for events in the queue. The producer thread then sends data to the queue and the separate thread reads them in the callback and operate on data.