05-04-2015 04:06 AM
Hi,
I have multiple parallel while loops running at different and ever changing rates. I communicate between loops with shared variables. I wish to execute the second loop only once the first loop has updated the shared variable witch is used by the second loop. i.e first loop runs, writes the shared variable at some point inside the loop (not at the end of the loop) and only at this time the second loop should begin running and when finished waits for the shared variable to be updated in order to run again. Any ideas how this can be acieved? Thanks
Solved! Go to Solution.
05-04-2015 05:42 AM
Hi lforni,
I wish to execute the second loop only once the first loop has updated the shared variable witch is used by the second loop. i.e first loop runs, writes the shared variable at some point inside the loop (not at the end of the loop) and only at this time the second loop should begin running
You should use notifiers (or a queue) instead of SharedVariables…
05-04-2015 10:00 AM
As Gerd says, Event, notifier or queue is the right tools for this.
/Y
05-04-2015 10:10 AM
Look at this paper about producer/comsumer design patterns: http://www.ni.com/white-paper/3023/en/
Steve