473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 5547
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ELO | last post by:
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...
2
by: hnkien | last post by:
Hi, I am writing a windows service with threading.timer for 10 seconds but it didn't work. Here are my code: namespace SchedulerService { public class ScheduleService :...
1
by: Tom | last post by:
I've googled, and read, and stripped out code, and rewritten code, and still can't get a System.Threading.Timer to work. (I hereby publicly admit that I'm a failure here...) Could someone please...
11
by: Maheshkumar.R | last post by:
Hi groups, How i can introduce some milliseconds delay in application. How i can do achieve this... let me clearly say... (1) I'm displaying slices of medical images. For framerate - for...
10
by: AmitTrehan | last post by:
hi friends, I want to know how can we insert delay in vb.net like..... i want to show two strings on same label first one string then break of 5 secs and then second string how can i acheive...
18
by: Max | last post by:
This is a follow-up on my previous thread concerning having the program wait for a certain date and time and then executing some code when it gets there. My question is; can I use the Sleep...
2
by: notregister | last post by:
I'm to delay my program for some limited time...i try using the following codes but it doesn't work, how do i do a time delay??? 'Extracted from the main function Timer11.Start() Do tCC =...
4
by: Henrik H | last post by:
Hi all! I have a Windows service, where I want to use a timer.. But it does not Seems work?? It does not catch the Timer1.tick event ??? But the code works on a form??? Can anyone help me,...
0
by: bg_ie | last post by:
Hi all, I'm writing a .net Com object to read messages from an external bus. Also, under certain situations, I output messages to the bus in order to generate bus load, for testing purposes. An...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.