LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Routine structure?

Dear Sir

 

            I would like to know how difference between series and parallel procedure routine, please see the attached file for your reference.

 

            Please let’s me know advantage/disadvantage between them.

0 Kudos
Message 1 of 3
(2,232 Views)

It's all about Data Flow.  In a Serial arrangement, Routine 2 cannot begin to run until Routine 1 finishes (and sends its data to Routine 2), and Routine 3 cannot begin to run until Routine 2 finishes.  Let's say Routine 1 takes 1 second, Routine 2 takes 2 seconds, and Routine 3 takes 3 seconds -- the Serial sequence takes 6 seconds.

 

When routines run in Parallel, the CPU time is "shared" between them.  There is no "predictability" to the order that code is executed -- in particular, you cannot predict which one finishes first, second or third.  If Routine 1 takes 1 second, Routine 2 takes 2, and Routine 3 takes 3, doing all three in parallel will take a minimum of 3 seconds (and, in many cases if the routines are not "compute-bound", they might all finish in 3 seconds, too, as Routine 3 can run while Routine 1 is "idle" (say, waiting for a File to open).  The three routines share the CPU, with cycles allocated according to some internal scheduling algorithm.

 

This makes LabVIEW an inherently parallel programming language.

 

Bob Schor

0 Kudos
Message 2 of 3
(2,215 Views)

Don't forgot with parallel processes you can use the snazy phrase "my code is optimized for multi-core computers"

0 Kudos
Message 3 of 3
(2,211 Views)