07-30-2013 08:27 AM - edited 07-30-2013 08:28 AM
Hi All,
I'm working with 4 while loops which are independent of each other i.e., there is no data flow from any loop to another.
I noticed that each while loop takes different time to complete one iteration.
However i want all the while loops to start and finish at the same time after each iteration.
How do I sync them?
Thank You for your reply.
Regards
Aveo
Solved! Go to Solution.
07-30-2013 08:31 AM
07-30-2013 08:33 AM
Aveo,
I don't think there is a useful way to synchronize while loops. Why don't you put all the code into one loop?
Cheers
Edgar
07-30-2013 08:40 AM
Can u share more details of what ur attempting to syncronize?
The loops will need have the same execution rate (Timing)? or only need have the same number of iterations?
Can u provide more information about the functions that are inside of the loop?
Can u tell about the elements ur using to "trigger" that loops to start? and to end?
Can u show some code? :[
07-30-2013 09:22 AM
I agree with ejkaiser...!!
Why specifically are you running (or want to run as) four different parallel loops.
07-30-2013 11:34 PM
Hi,
Thank you all for your replies.
Putting all the code into a single loop is a good idea. But i cannot use it in my application.
I want to processing 4 sets of images simultaneously(The same object is captured from 4 different angles. All the images need to be processed at the same time for drawing a conclusion).
Also To increase the execution speed, i am planning to put them into individual loop and assign a processor to each loop.
This will not be possible if i put everything into a single loop.
I think the use of "rendezvous" or "notifier" with timed loops might work out.
Shall try it now.
Regards
Aveo
07-30-2013 11:38 PM
Hi,
Thank you for your reply.
I think your idea will work out.
I have one request. I have never worked with a timed loop or "rendezvous".
Will it be possible for me to get a example for them?
Thanks
Aveo
07-31-2013 04:14 PM
Aveo,
You may not need separate loops and you may not need to assign them to separate processors. LabVIEW's internal scheduler can do that when tasks are not dependent on each other. NI has put much effort into improving the performance of parallel calculations.
What you need to do is to make sure that there are no data dependencies between the parts you want to do in parallel. You may also need to make subVIs reentrant.
Please post your code. Some particpants on the Forum are very good a optimizing performance.
Lynn
07-31-2013 07:12 PM
@johnsold wrote:
Some particpants on the Forum are very good a optimizing performance.
Would you say some participants are "wizards" at optimizing performance?
07-31-2013 07:16 PM
That is a magickal way of expressing it.
Lynn