G
Guest
I have this simple windows service, it uses a timer that calls a routine
every 10 minutes. Usually this routine takes about 30 seconds to run but
sometimes it might run for 15 minutes under some circumstances, this is
supposed to happen.
What happens when the timer event gets (or should be) raised even if my
routine is still running. Is the routine exited and called again, is the
routine called again right after it's done because the timer elapsed during
its run (this is what my tests suggested here) ?
In short, it seems the decent thing to to is to stop the timer when the
routine gets called and start it again when it's done but is it dangerous to
leave it running even if it might elapse while the routine is running ?
every 10 minutes. Usually this routine takes about 30 seconds to run but
sometimes it might run for 15 minutes under some circumstances, this is
supposed to happen.
What happens when the timer event gets (or should be) raised even if my
routine is still running. Is the routine exited and called again, is the
routine called again right after it's done because the timer elapsed during
its run (this is what my tests suggested here) ?
In short, it seems the decent thing to to is to stop the timer when the
routine gets called and start it again when it's done but is it dangerous to
leave it running even if it might elapse while the routine is running ?