Problems using System.Threading.Timer
From: Michael Groeger (google.news_at_web.de)
Date: 09/20/04
- Next message: Dilbert Smith: "C# Zero-Fill Right Shift Bitwise Operator? (Similar to >>> in JavaScript)"
- Previous message: John Giblin: "Starting a process on a network drive"
- Messages sorted by: [ date ] [ thread ]
Date: 20 Sep 2004 09:10:20 -0700
Hi NG,
I am a little bit confused about System.Threading.Timer. I am using
two Timer objects which control uptime of my apps. One is used to
notify my apps to suspend and one is used to notify them to resume.
One of my apps is running from 7am to 22pm. Under normal
circumstances, it works fine. I'll receive one event at 22pm and one
again at 7am. When starting the app the time till 7am/22pm is
calculated and set as dueTime parameter and the period parameter is
set to 1 day.
Under any other circumstance - which I can't define, because I don't
really have an idea what happens - the timer callback for the resume
time is invoked periodically ... at any time ... in any other period
than 1 day ...
So far, so good. But the thing is getting even more weird when closing
the application and starting it up again: the timer seems still to be
confused.
I started to change the values of dueTime and period to 1 Minute and 1
second. The timer callback was invoked as expected... first after 1
minute and then every second. Changing the values back again ended up
in permanent callback invokations.
Then, I tried a second application which was used for testing purposes
of my Uptime Management component. I set the values to the same values
as in my normal application. Now, the callback for the resume timer
was invoked once immediately but then it seemed to work correctly.
Okay, now the "funny" part: after rebooting, the same component using
the same values worked for both applications as expected. Until the
next time "any under circumstance" happens ...
I have digged deep into the microsoft ng's, but without finding a
solution or even somebody having the same problem.
Can somebody help with this? Is there anybody out there having similar
problems?
Kind regards,
Michael
- Next message: Dilbert Smith: "C# Zero-Fill Right Shift Bitwise Operator? (Similar to >>> in JavaScript)"
- Previous message: John Giblin: "Starting a process on a network drive"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|