Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2007

Tip: Looking for answers? Try searching our database.

Timer used in Windows Services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew - 07 Aug 2007 01:22 GMT
Hello, friends,

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.
Peter Duniho - 07 Aug 2007 01:33 GMT
> 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
[quoted text clipped - 3 lines]
>
> 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
sloan - 07 Aug 2007 01:43 GMT
You should "code up" a timer.

http://groups.google.com/group/microsoft.public.dotnet.framework/browse_thread/t
hread/aa8a7a59b698f6b5/009395e3234a3dbc?lnk=st&q=sloan+%22Private+m_doTheWorkTim
er+As+Timer%22&rnum=3#009395e3234a3dbc


I think I have a link at the bottom of that post, which refs a MS KB article
about the "why".

or

http://groups.google.com/groups/search?q=sloan+%22Private+m_doTheWorkTimer+As+Ti
mer%22


or

http://msdn2.microsoft.com/en-us/library/system.threading.timercallback.aspx

> Hello, friends,
>
[quoted text clipped - 6 lines]
>
> Any good/reliable solutions/approaches for this? Thanks a lot.
GlennDoten - 08 Aug 2007 16:47 GMT
> You should "code up" a timer.
>
> http://groups.google.com/group/microsoft.public.dotnet.framework/browse_thread/t
hread/aa8a7a59b698f6b5/009395e3234a3dbc?lnk=st&q=sloan+%22Private+m_doTheWorkTim
er+As+Timer%22&rnum=3#009395e3234a3dbc

>
> I think I have a link at the bottom of that post, which refs a MS KB article
> about the "why".

Isn't it just a problem in .NET 1.0 and 1.1 but not in 2.0 and later?

The KB article that is pointed to in the thread you posted says those
are the versions the bug applies to, but I wonder if it was written
before .NET 2.0 was out?

http://support.microsoft.com/kb/842793

Signature

-glenn-


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.