01-29-2010 08:30 AM - edited 01-29-2010 08:32 AM
stu22,
Depending on the requirements, a Producer-Consumer or State Machine are just a couple of ways to avoid race issues caused by variables. The use of Functional Global Variables/Action Engines would also help your code. Just too many loops running in parallel.
Definitely an echo in here today.
In looking at your code, I did notice that you are reading individual cFP channels the hard way. See below.
01-29-2010 11:49 AM
01-29-2010 12:11 PM
leonardolt wrote:
Could you also post in LV 7.1, please?
Who are you asking? Which attachment?
If you are asking the original poster, it is a bit much to ask someone who is a newer user to save as a much older version. LV7.1 is 5 versions older than the current version. If they don't have LV 8.0, which they probably don't if they are a newer user asking questions, they aren't going to be able to.
01-29-2010 12:27 PM
Dear Ravens, you are right, I was asking Stu to post his lib in LV 7.1. I just have that version to work with, so I don't even know how it has to be done in other versions.
Now, Stu, if you don't feel confortable posting your file in such an old format, I'm awful sorry, it was really not my intention to bother you. I wasjust trying to help.
Leo
02-01-2010 09:47 AM
A few interesting resources for your peruseal...
Video: Local Variable, Global Variable, and Race Conditions
http://zone.ni.com/devzone/cda/tut/p/id/7585
Tutorial: Local Variable, Global Variable, and Race Conditions
http://zone.ni.com/devzone/cda/tut/p/id/7585
Are LabVIEW global variables good or bad, and when is it OK to use them?
http://zone.ni.com/devzone/cda/tut/p/id/5317
05-25-2021 12:50 PM
Paul,
What about using reentrancy to resolve Race Conditions? As I understand it, clones of the shared resource will be created to allow simultaneous access.
05-25-2021 03:15 PM - edited 05-25-2021 03:16 PM
@ooyeniyi wrote:
Paul,
What about using reentrancy to resolve Race Conditions? As I understand it, clones of the shared resource will be created to allow simultaneous access.
If you are marking your clones as rerentrant you are actually increasing the odds of races conditions. If you are accessing a shared resource of some type (global or local variable) and you are spawning reentrant clones you are increasing the number of threads/processes that will be trying to access the data at the same time. This is not an issue if you have a WORM (Write Once Read Many) global or local variable since the data is static and you are simply reading it. However, once you start modifying the data in more than one place, you will have race conditions unless you implement some type of locking mechanism.
BTW, you do realize that your are replying to an 11 year old thread. Quite possible that none of the people originally involved in th ediscussion are still here.