what\'s the best way to make main thread to wait until all threads are finished?
for(int i=0;i
List threads = new ArrayList(); for(int i=0;i