Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 68974

Why should Shared Variables be serialized?

$
0
0

The Best Practices (Real-Time) Help for Shared Variables in LabVIEW (2012) says "Improve performance and prevent race conditions by executing shared variable accessors serially", and then gives some examples with further comments about not accessing them in parallel.

 

Can someone explain why performance is improved and race conditions avoided this way?  I'm assuming, of course, that each of the Shared Variables you access is unique (clearly trying to write to the same variable twice is better done in serial, as it is "deterministic" -- when the code finishes, the S.V. will have the second (last entered) value).

 

I've noticed these snaky error lines used to serialize several Shared Variables, and never understood "Why".

 

Bob Schor


Viewing all articles
Browse latest Browse all 68974

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>