Hi,
I am using a timer that runs every 10 seconds. The TimerTask functionality
I implemented starts three threads every time the timer runs.
If those threads did not finish executing within 10 second, another
timer interval will start and three new threads will start. As over all,
I will have at least six threads in the JVM.
My question : How can i prevent overlapping of timer intervals.Which
I do not the second interval to start if there is a
thread from the
first interval still running.
As an initial solution I am using Thread.activeCount to check
wether the number of active threads exceend a certain limit. Of so, I
end run function of the TimerTask by a return statement.
What do you think
[ September 18, 2007: Message edited by: Khaled Mahmoud ]