I have a Parent Class which spawns 10 child threads,
class Parent{
public static void main(
String[] args) {
int threadWorkerNo = 10;
processStartTime = System.currentTimeMillis();
spawnThreads(threadWorkerNo);
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
}
private static void spawnThreads(int number){
for(int i=1;i<=number; i++){
String name = Integer.toString(i);
MigrationWorker th = new MigrationWorker(name);
th.startThread();
}
}
}
Assume the MigrationWorker is a
Thread Class which does some work.
now i want the Parent class main method to wait till all the 10 migration workers thread are died.
That means when all the 10 child threads are dead,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& will be printed.
Thanks in advance....
[ April 09, 2007: Message edited by: Purujit Saha ]
[ April 09, 2007: Message edited by: Purujit Saha ]