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 to start from this list creating a thread for each one independent. For each one to do its processing.
Currently I use only that waiting 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();
What is it like?