From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(2,300 Views)

Hi Raj,

 

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

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,291 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
(2,288 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
(2,258 Views)