LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

thread setup timing takes way too long

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

0 Kudos
Message 1 of 3
(4,037 Views)

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.

0 Kudos
Message 2 of 3
(4,030 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 3
(4,008 Views)