Posted By:
Edward_Harned
Posted On:
Saturday, September 12, 2009 02:50 PM
When you exit the run() method the thread will be destroyed and eventually the resources will be freed. Exactly when that happens naturally depends on a lot of issues.
Usually the better way, when using many threads, is to re-use the threads that finish the work. This is where a Queue and thread pool come into use. While there is a thread pool class in java, using such is not for beginners.
We could talk all day on how to do this and just what the problems are but it might be easier to read an article I wrote last spring and you can download an open source product that might fit your needs. ( http://coopsoft.com/ar/j2searticle.html )