06-16-2016 07:26 AM
Hello NI Forum.
I need an help for a "could be" problem during the developping of an application. If i use an array, with fixed dimension, which share data between parallel tasks where each task always write in a certain, fixed, index could bring in concurrency problem? For example: task 1 always write in index 1 and task 2 always write in index 2, if the two task write in the same time at the respective index what could happen? Two or more task that use the same resource (array) at the same time but at different index (different memory location) could bring to concurrency problem?
Thank you in advance
.
06-16-2016 07:34 AM
How do you write data into the array parallely? Are you using a Global variable?
06-16-2016 07:40 AM
No, it's a local variable. But i think that i'll go for the safety road and use a semaphore....
06-16-2016 08:02 AM
You should also look at Data Value Reference which is a newer addition to LabVIEW then a semaphore which locks out other loops from writing to the data reference while another is working with it.
You should also look at Functional Global Variables where the array is stored in a non-reentrant subVI and that prevents an array from being updated at multiple locations simultaneously.
06-16-2016 08:36 AM
In this case, I would go with the Action Engine. I have found they are faster than the DVR.
And now for a shameless plug since it applies here: A Look At Race Conditions
06-24-2016 01:12 AM
I did'nt know the action engine. Sound really interesting, can you please give me some link to learn more about it?
Thank you,
Francesco.
06-24-2016 01:17 AM - edited 06-24-2016 01:17 AM
I can give you, its right here
06-24-2016 01:18 AM
Search is your friend
Community Nugget 4/08/2007 Action Engines
06-24-2016 01:44 AM
Thank you all guys!!