System.Threading.Timers.Timer (also) has issues

As many .NET developers know, we can't use System.Timers.Timer because it sometimes does not fire the events in time. Hence, we are recommended to use System.Threading.Timers.Timer.

Yesterday I found one issue with this timer as well which I wanted to point out:

http://msdn.microsoft.com/en-us/library/yz1c7148(v=vs.100).aspx

If you pass infinite as the due time then on some servers, the timer just stops working and never fires again. I usually test with all windows updates (optional + important). On such a system this never happened.

However, we did notice this happening on a test machine yesterday. It was a 2008 R2 VM.

To get it working, I pass the same value as period to the due time. So far, this seems to be working.

[Update] It does not work. I now stop the timer, reset the interval and start it again. Hopefully this works.

Comments

Popular posts from this blog

Tutorial: Using Google Cloud Storage from C# and .NET

Late 2008 Macbook only giving 1.5 gb/s speed with 6 gb/s Intel SSD?

The ridiculous interview experience