473,326 Members | 2,175 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,326 software developers and data experts.

How many timers?

How many System.Threading.Timer timers can os "reasonably" handle? What is
the cost in mem? I think this is a wraper for win32 TimerQueueTimer (not
sure), but wonder what general implementation is. A queue of objects that
one thread keeps checking to see it time expired, etc. TIA

--
William Stacey, MVP
Nov 16 '05 #1
2 7451
System.Timers.Timer is a wrapper for the NT Waitable Timer.

System.Threading.Timer is a CLR threadpool based timer which fires its events on threadpool thread. I just looked in reflector to find out the implementation details but unfortunately the crucial method AddTimerNative is marked as internalcall.

I'll have to have a dig in the ROTOR code and see.

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<O7*************@TK2MSFTNGP10.phx.gbl>

How many System.Threading.Timer timers can os "reasonably" handle? What is
the cost in mem? I think this is a wraper for win32 TimerQueueTimer (not
sure), but wonder what general implementation is. A queue of objects that
one thread keeps checking to see it time expired, etc. TIA

--
William Stacey, MVP

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004

[microsoft.public.dotnet.languages.csharp]
Nov 16 '05 #2
Richard,

You are right, System.Threading.Timer takes advantage (on W2K, XP and W2K3 -
don't know about other OSses) of the OS "TimerQueue" threadpool.
By default, this thread pool has a maximum of 500 threads, as far I can see
the CLR (v1.1) doesn't change this value.
One CLR System.Threading.Timer maps onto one "timer queue timer by(calling
Win32 CreateTimerQueueTimer), so we can assume the maximum is 500.

Willy.

"Richard Blewett [DevelopMentor]" <ri******@develop.com> wrote in message
news:Ob****************@tk2msftngp13.phx.gbl...
System.Timers.Timer is a wrapper for the NT Waitable Timer.

System.Threading.Timer is a CLR threadpool based timer which fires its
events on threadpool thread. I just looked in reflector to find out the
implementation details but unfortunately the crucial method AddTimerNative
is marked as internalcall.

I'll have to have a dig in the ROTOR code and see.

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<O7*************@TK2MSFTNGP10.phx.gbl>

How many System.Threading.Timer timers can os "reasonably" handle? What is
the cost in mem? I think this is a wraper for win32 TimerQueueTimer (not
sure), but wonder what general implementation is. A queue of objects that
one thread keeps checking to see it time expired, etc. TIA

--
William Stacey, MVP

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004

[microsoft.public.dotnet.languages.csharp]

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: GDumencu | last post by:
I have a C# program that have to run all the time. For some reasons I cannot make it a service. This program has 3 timers and by time to time ( days or weeks) one of them stops. Some times, starts...
0
by: Dmitry Demchuk | last post by:
Hi everybody. Recently I ran into situation with System.Threading.Timer in my ASP.NET application. I reinstalled Windows on one of my servers and got timers stop firing events after while, they...
0
by: Cider123 | last post by:
I was originally using: System.Windows.Forms.Timer It started to lock my Window Service up, so I went to the next evolution: System.Threading.Timer All was good. I was using it to send...
3
by: Nathan Kovac | last post by:
I have a feeling I am missing something simple, but I just can't find it. Perhaps someone can give me a lead on where to look. I will describe the issue then post my code to the web service. My...
3
by: Jeff Greenland | last post by:
Hello everyone, I am having problems with Timers in a web application. They just seem to stop running after 15 minutes or so. My web application is set up like this: When a user hits a...
9
by: Mark Rae | last post by:
Hi, I've seen several articles about using System Timers in ASP.NET solutions, specifically setting them up in Global.asax' Application_OnStart event. I'm thinking about the scenario where I...
10
by: WhiteSocksGuy | last post by:
Help! I am new to Visual Basic .Net (version 2002) and I am trying to get a System.Timers.Timer to work for me to display a splash screen for about two seconds and then load the main form. I have...
5
by: Michael C# | last post by:
Hi all, I set up a System.Timers.Time in my app. The code basically just updates the screen, but since the processing performed is so CPU-intensive, I wanted to make sure it gets updated...
1
by: | last post by:
Frustrated.. (I have seen other posts regarding this problem with no resolution..) I am using dotnet 1.1 with latest SP on a Win2KP box (actually 2 boxes), have even run the service on WinXP SP2...
1
by: Jonathan Woods | last post by:
Hi there, I have three methods these need to execute at every interval time. I would like to know which option is better? Option A) Three System.Timers.Timer objects these execute each...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.