LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can correct data flow avoid race condition with locals

My project is using locals because we have multiple parallel loops and

also have multiple controls (different ways of interpreting the meaning

of a control) for the same value. 

 

I'm still in the process of trying to absorb the subtleties of using

locals vs. using property nodes from the help files and the

veritable plethora of threads on the subject here.  As I understand it,

as long as I  have proper data flow between a read local and its

corresponding write local, there will be no race condition.  Is this correct?


 

For example (sorry, too lazy to make a screen shot)

 

[read local] --->(code to modify value)--->[write local]

 

So, only a race condition if my read and write have no data 

flow between them right?

 

  [read local] --->(some code)

 

       (other code) ---> [write local]

 

 

Do I understand this correctly?

Thanks and Best Regards,

 

J.

 

 

0 Kudos
Message 1 of 3
(2,716 Views)

JeffBuckles wrote:

Do I understand this correctly?


Yes.

 

However, since you have parallel loops you might get a race condition between the two loops.


JeffBuckles wrote:

I'm still in the process of trying to absorb the subtleties of using

locals vs. using property nodes from the help files and the

veritable plethora of threads on the subject here. 


Locals and value property nodes (and global and shared variables) all have the same potential  for race conditions.

 

Property nodes are synchronous and thus more expensive than local variables.

0 Kudos
Message 2 of 3
(2,713 Views)

Ditto Christian's comments.

 

My Nugget on Action Engines may be helpful with handling race conditions.

 

Take care,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 3
(2,677 Views)