1
I have a query where returns a list of results;
Example:
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
I would like from that list to create a thread for each one independent. For each to do their respective processing.
Currently I use only that waits for one to finish for the other to process
new Thread(){
public void run(){
MeuController mc = new MeuController();
List lista = mc.getMetodo();
Iterator it = lista.iterator();
while( it.hasNext() ){
Model model = (Model) it.next();
//agora vai processar
}
}
}.start();
Has as?
And is this chunk of code inside a loop? At what point are you waiting to thread finalize?
– Woss
No. Only inside it that has a while
– adventistaam