One area in my code that could benefit from threading is the
following:
File[] dirChildren = gmlDir.listFiles(filter);
for(File aFile : dirChildren) {
System.out.println("Got here!");
//Iterate through the list of files and start loading
GML files:
GMLThread thread = new GMLThread(aFile);
thread.run();
try {
thread.join();
}
catch(InterruptedException ie) {
ie.printStackTrace();
}
System.out.println("Got here! 2");
}
I'm not loading one XML file, but several in a directory. However, I
can't figure out how to iterate through the File arraylist and start
several parsing threads, whilst making the main application thread
wait until they've have all completed? The current code above only
makes the "for each" loop wait until the thread its spawned has
completed, which isn't the behaviour I want.