473,396 Members | 1,724 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,396 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 5552
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.