LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Race condition

Hi friends,

 

I have one clarification that i have 5 clone vi and one array in single  global variable .

Each clone vi write  element in particular index of array parallely.

 

consider while clone0.vi write 0 index of array at the sametime clone.vi write 1 index of array,so is this case make race condition,

 

my doubt is if we write one elemenent by all at parallely its make race condition,but inthis case i write invidula element in the array...so its arise the doubt.pls tell me

Raj
0 Kudos
Message 1 of 4
(1,163 Views)

Hi Raj,

 

yes, there can easily arise a race conditon. Why not use a FGV instead?

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 4
(1,154 Views)

Hi Pandiyan,

If you have 5 clone VI and one array in global variable, during the execution where the 5 VI run together and will update the array global variable without any mechanism to protect the access to the array, you WILL have race condition.

 

I hope that this clarify your doubt.

 

Regards

 

- Meadow -
LabVIEW 7.0 - 2011, Vision, RT, FPGA
TestStand 3.0 - 4.5
0 Kudos
Message 3 of 4
(1,151 Views)

That faliure scenario is very similar to the example of a Race Condition I included in my Action Engine Nugget.

 

This is apreview of that thread.

 

 

See that nugget to find a way of avoiding the race condition without resorting to semaphores etc.

 

Ben

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