The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Design Patterns: Multiple Loops

SercoSteveB
Active Participant

Which of the following are reasons for using a multiple loop design pattern?

a) Execute multiple tasks concurrently

b) Execute different states in a state machine

c) Execute tasks at different rates

d) Execute start up code, main loop, and shutdown code

https://decibel.ni.com/content/docs/DOC-21613

Comments
crossrulz
Knight of NI

A & C


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
mini09
Active Participant

A, I have a confusion in option C. If we have multiple loop at different rate of delays will it not affect the entire program delay?

LordNobady
Member

A and C

@gnshmrthy

If you place the loops in paralel then the program length is the time the longest loop is running.
Common things to do in paralel are:

- Interfacing ( users, devices, databases, files )

- Programing logic ( calculations, desisions )

depening on requierments there can be multipe loops for every one of these. A commom usage case is the producer consumer.


Learning LabVIEW since January 2013
crossrulz
Knight of NI

gnshmrthy wrote:


                       

I have a confusion in option C. If we have multiple loop at different rate of delays will it not affect the entire program delay?


                   

Have you heard of Multicore?  Well, it actually comes down to multi-threading.  A thread is a single process that runs as its own little program.  So what happens when you have multiple loops with no data dependency?  LabVIEW turns each parallel process into its own thread.  So the loops do not affect each other other than possibly the communication scheme.  And with multi-core, you can have different threads truely run at the same time.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
MrStevenUND
Member

A & C. 

BPerlman
Member

A & C

Ihab
Member

A

ljbandres
Member

A & C

edgar01
Member

A and C

SercoSteveB
Active Participant

Answer:  A & C.  Nice one crossrulz, LordNobady, MrStevenUND, BPerlman, ljbandres & edgar01.

eleshrudra
Member

A and C

R.Elesh
Sangameshsh
Member

A and c