fenris,<br><br>I thought of a better solution. The old one would need one array of String for input files, another array of String for output files, and then maybe a Vector of Integer for keeping track of indexes.<br><br>Get rid of all that and just have one Hashtable. The key will be a String representing the input file, and the value will be the corresponding output file. If you create an enumeration loop, each thread will remove the key/value it's currently working on. Then, the next thread won't go looking for that one as it has already been removed. (You could also have it be a Hashtable with File types). One of the bigger benefits of this is the fact that you're not adding to memory, you're releasing it. With two arrays and a vector, you're constantly adding to a vector- creating more memory. With this situation of one hashtable, you are constantly removing items, releasing memory. Sounds better to me.<br><br>have this in your run method:<br><br><FONT FACE=monospace>for (Enumeration e = fileContainer.keys(); e.hasMoreElements()

{<br> String inputFile = e.nextElement().toString();<br> String outputFile = fileContainer.remove(inputFile).toString();<br> // perform file copying<br>}</font><br><br>I'm not sure if the enumeration is automatically updated as keys are removed from the hashtable. You might need this instead (but I'm not sure):<br><br><FONT FACE=monospace>for (Enumeration e = fileContainer.keys(); e.hasMoreElements()

{<br> String inputFile = e.nextElement().toString();<br> String outputFile = null;<br> try {<br> outputFile = fileContainer.remove(inputFile).toString();<br> catch (NullPointerException npe) {<br> continue;<br> }<br> // perform file copying<br>}</font><br><br>I think that would work. You'd need to create your Hashtable variable outside of everything- either that, or you'd have to pass it in to the constructor for your threads.<br><br>Also, you can create as many threads as you'd like- it's completely arbitrary. You might also want to have a timer that starts right before the first thread starts and ends right after the last thread dies. This could tell you to some degree the relationship between number of threads in action and the time it takes to complete file copying. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=
] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.