Hello
DAQ should always be running at the same or a higher priority if you want to keep the data transfer rate high and/or avoid any buffer overflow problems.
I doubt making local copies would provide any dvantage in terms of performance , since now you added the overhead of making the copy. Not to mention adding the overhead of thread local variables into the equation might actaully slow things down for you a little more. You could, however, make sure that you lock sections that you absolutely need to. But I guess this would start depending on your application and how that is set up. But generally make sure your critical sections contain as few instructions as possible.
If you are expierencing sluggish UI behavior, you might also want to check that you
are making good use of ProcessSystemEvents() in your app.
If the first thread does go ahead a lock the global resource before using it, you want to make sure that it releases it only after its done using it. You should not grab and release a lock in every iteration of a while loop, simply becuase its not efficient and the first thread could get preempted at any time by any of the other threads that you created. There is no guarantee of which thread you could be preempted by, since this is something the OS is incharge of. Windows uses a thread scheduler that makes little distinction between threads that represent different process and threads in the same process. CVI lets the OS handling thread scheduling for it.
If you want more information about the sync primitives available in CVI, check the link
hereI hope this helps
Bilal Durrani
NI
Bilal Durrani
NI