Re: Timer used in Windows Services
- From: Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Mon, 06 Aug 2007 17:33:21 -0700
Andrew wrote:
I am programming a Windows Service using .net 2005. In this service, I need a timer to check file status in a predefined interval. However, as you may have experienced by yourself or read through internet, the System.Timers.Timer() is not reliable: The timer event may not be fired at all sometimes.
Any good/reliable solutions/approaches for this? Thanks a lot.
The only problem I've read about with respect to any timer problems in ..NET is a timer that has been configured to repeat, and which has been left running for an extended period of time (I don't recall the specifics, but "49 days" seems to pop into my head for some reason).
If your application is one that might be affected by this, my understanding is that simply changing the timer usage so that you reset the timer each time it is signaled, and start it again with a new interval, it works fine.
If you expect there to be a problem, my suggestion is that you first reproduce the problem in your own code. Then you will have a better idea of whether it's really a problem, and you will be able to ensure that you have satisfactorily worked around the problem.
Pete
.
- Prev by Date: Re: Everyone's favourite error message
- Next by Date: Re: Timer used in Windows Services
- Previous by thread: Team Foundation Server Dual-Server Installation
- Next by thread: Re: Timer used in Windows Services
- Index(es):
Relevant Pages
|