LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how create multithreading dynamically?

Hi, 

There is a 2D-Array.I need create multithreading for processing it row by row.Is there any way  can do that?If can,please give me a example vi.Thanks a lot!

0 Kudos
Message 1 of 12
(3,829 Views)

What version of LabVIEW do you have?  LabVIEW 2009 has a new feature on For Loops that allow you to have the iterations run in parallel.

 

What processing do you want to do on each row?  You could use several index array functions to get a particular row, and pass the data off into queues and have parallel while loops operating on the elements that come out of the queues.

0 Kudos
Message 2 of 12
(3,824 Views)

hi,Ravens Fan

My labview version is 8.5.My Application controls equipments.The data  should process one by one in the same row, but the data can process at the same time in different rows.    

0 Kudos
Message 3 of 12
(3,807 Views)
How many do you want to run at the same time?  Let's say 4.  Use decimate array to break your array into 4 parts.  Feed each part to its own For Loop for processing.  Use Interleave Array to put the results of the 4 loops back together.
0 Kudos
Message 4 of 12
(3,790 Views)
...Row's number is uncertain,so I should create multithreading dynamically.
0 Kudos
Message 5 of 12
(3,767 Views)

It will handle any number of rows.

 

I don't see any way you can handle an unspecified number of threads.  At some point you are going to have to determine how many different rows you want to be processing at the same time.  There is a practical limit, and that limit isn't that high of a number.  Once you determine how many to process at the same time, then you just decimate your array of whatever size it is among those X number of processes.

0 Kudos
Message 6 of 12
(3,764 Views)

Hi,

I create a reentrant vi for processing which is invoked dynamiclly by main vi  in the example.Is it multithreading ?

0 Kudos
Message 7 of 12
(3,747 Views)
I dont think its mutlithreading (as per the data flow model).
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 8 of 12
(3,733 Views)

Hi,Baji

I think the main vi just invokes the process vi and  doesnt wait until it done.Only the time running is different each other. 

0 Kudos
Message 9 of 12
(3,731 Views)
In the for loop the process VI waits for the input and it gets executed.So nothing is happening in parallel.Check the attachment
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 10 of 12
(3,728 Views)