It has already helped me on one thing and I was wondering if I could confirm this with you ? I was reading more about the Timer class and realized that I had misunderstood it. My one thread that has a constant while(true) loop will periodically need to start the new TimerTasks. I thought I needed to create a new Timer() object for each task, but if I am understanding correctly I can just make one Timer class, and then add the tasks to it as needed, thus cutting down on the number of threads greatly. Is that correct? The Timer object itself starts a thread, and then all the tasks will get handled by that one thread?
Glad to hear that it helped ...
Yes. You can "just make one Timer class, and then add the tasks to it as needed, thus cutting down on the number of threads greatly". And yes, "all the tasks will get handled by that one thread" of the java.util.Timer class.
Keep in mind that the tasks must be short lived, since there is only one thread, if your tasks take too long to run, you can starve out the other tasks.
Also, there may not be a need for your "thread that has a constant while(true) loop [which] will periodically need to start [or add] the new TimerTasks". If you are running the same timer task, at regular intervals, there is an overload schedule() method that lets you do this.
Henry