471,594 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Delay problem with System Threading Timer

ELO
Hi all

Every week, I need to get two files on a remote server.
I have developped a C# Windows Service with two System.Threading.Timer to do this task

For the first one, the delay (TimeSpan dueTime) is always set to 6 days, 23 hours, 59 minutes, ..

Some weeks ?!?, the timer restarts immediately after its execution (and loop indefinitely). I have made a lot of tests and this issue does not occur with a delay < 1 day ..

Any suggestion

Thanks
Emmanue
Nov 16 '05 #1
3 5363
maybe the timer creation fails? I think you can only create a limited
number of them.

ELO wrote:
Hi all,

Every week, I need to get two files on a remote server.
I have developped a C# Windows Service with two System.Threading.Timer to do this task.

For the first one, the delay (TimeSpan dueTime) is always set to 6 days, 23 hours, 59 minutes, ...

Some weeks ?!?, the timer restarts immediately after its execution (and loop indefinitely). I have made a lot of tests and this issue does not occur with a delay < 1 day ...

Any suggestion ?

Thanks,
Emmanuel

Nov 16 '05 #2
maybe the timer creation fails? I think you can only create a limited
number of them.

ELO wrote:
Hi all,

Every week, I need to get two files on a remote server.
I have developped a C# Windows Service with two System.Threading.Timer to do this task.

For the first one, the delay (TimeSpan dueTime) is always set to 6 days, 23 hours, 59 minutes, ...

Some weeks ?!?, the timer restarts immediately after its execution (and loop indefinitely). I have made a lot of tests and this issue does not occur with a delay < 1 day ...

Any suggestion ?

Thanks,
Emmanuel

Nov 16 '05 #3
Was there any resolution to this issue?

I have a windows service that schedules various tasks using the System.Threading.Timer class. On some rare occasions after waiting the appropriate amount of time to fire, the timer continues to fire rapidly. I haven't been able to reproduce this behaviour, but I have had numerous customers report it. Customers first reported that a task scheduled every 28 days had ran when it was scheduled, but then continued to run again and again almost every second. At first I thought this was only affecting tasks with a very long interval, but since then it has happened with tasks scheduled every 6 hours and every 24 hours.

As a side note I had originally been using System.Timers.Timer, but switched to System.Threading.Timer due to a confirmed bug (KB 842793) that can cause a System.Timers.Timer to stop firing. It appears System.Threading.Timer may have a bug too, only instead of not firing it fires too much!

"ELO" wrote:
Hi all,

Every week, I need to get two files on a remote server.
I have developped a C# Windows Service with two System.Threading.Timer to do this task.

For the first one, the delay (TimeSpan dueTime) is always set to 6 days, 23 hours, 59 minutes, ...

Some weeks ?!?, the timer restarts immediately after its execution (and loop indefinitely). I have made a lot of tests and this issue does not occur with a delay < 1 day ...

Any suggestion ?

Thanks,
Emmanuel

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by hnkien | last post: by
11 posts views Thread by Maheshkumar.R | last post: by
10 posts views Thread by AmitTrehan | last post: by
2 posts views Thread by notregister | last post: by
4 posts views Thread by Henrik H | last post: by
reply views Thread by bg_ie | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.