04-25-2014 10:16 AM
Hello all,
I am currently refactoring a large application (i.e. cleaning up my own mess) and have a question about architectures for sharing data between parallel processes. In our application, I have identified 7 different parallel processes that are required: UI/server (acting as the master), camera, DAQ, motor, processing, display, and saving (all acting as slaves). I have modelled the application after the “Continuous Measurement and logging” template and am using queue driven message handlers (QDMH) for each of the parallel processes. When the UI launches, it creates the QDMHs and passes them to each of these processes running as a subvi within the main application.
The issue I am having is which design to use to share lots of variables (>50, no arrays) that are used in each of these parallel processes. By share, I mean one process is the “owner” of the variable but the other processes derive data from that variable. For instance, the number of camera pixels used will affect the camera loop and is owned by that process, but this will also affect the display loop (how big is the axis) and the processing loop (defining array sizes). Our application has a number of different “states” in which some of these variables change (e.g. going from an acquisition mode to a post processing, and then in post processing loading a previous acquisition with completely different parameters) but not necessarily all of them.
At this point, I can see a few different architectures, each with their own positives and negatives:
Are there any other ways of communicating the data that I am missing? Are there any positives/negatives for the three architectures I have listed that I have missed? Does anyone have any preferences from their own experiences?
Thanks for the help!
04-25-2014 12:01 PM
Since you are dealing with a large cluster, I would likely go with the FGV. Inside of the FGV you just update the parameter(s) you need to. This will avoid some of the race conditions since you should be protecting the critical path. You will need an input for each data type the cluster contains plus an enum to tell the FGV which parameter to update (or just read the cluster value). As long as you keep the FGV very simple, you won't have to worry about the blocking. It will be done quick enough.