03-26-2012 11:26 AM
I have two sub VIs to run, which take a little longer to run.
What i mean is for example when both the blocks are given input signals at the same time, block A takes 10sec to run and then block B is taking 8sec to run.
What i want is to run the two blocks in parallel. That is, while block A is running block B should run in parallel so that over all it takes only 10sec for getting the output.
Is it possible to do so and how?
I have a dual core processor.
03-26-2012 11:50 AM
Vanteru,
By placing the sub vi's in parralel instead of in series they will run as quickly as the processor can handle them.
What I mean by parralel is that neither vi requires an input from the other. The picture below shows two Means being calculated at the same time because neither requires an input that is an output from the other function.
03-26-2012 12:02 PM - edited 03-26-2012 12:03 PM
What i meant was some thing like this.(as shown).
I want the mean and variance blocks to run parallel.
03-26-2012 12:23 PM
They should already be running in parralel since the variance does not depend on any outputs from the mean, and the mean does not depend on any outputs from the variance.
03-26-2012 12:29 PM
No its not running in parallel. Check for your self. Just place a sin and cos blocks and check with bulb symbol on. One of them is run first and then runs the second.
I want them both run at same time.
03-26-2012 01:08 PM
The "bulb" symbol may cause the execution to be serialized. Have you tried just running the VI as fast as possible (no debugging) and then watching the cores to see if they are both getting activity?
Other things affect parallelism as well. For example, all of the sub VIs should be reentrant to ensure the sub VIs code does not behave like a critical section and block other callers. If those are native LabVIEW functions, they should probably already be reentrant.