Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: Class not registered error Pin
Heath Stewart20-Nov-03 7:20
protectorHeath Stewart20-Nov-03 7:20 
GeneralSuspend Windows... Pin
nzwy1p20-Nov-03 0:28
nzwy1p20-Nov-03 0:28 
GeneralRe: Suspend Windows... Pin
Heath Stewart20-Nov-03 3:17
protectorHeath Stewart20-Nov-03 3:17 
GeneralTimer trouble -timer "dies" Pin
EnkelIk19-Nov-03 21:09
EnkelIk19-Nov-03 21:09 
GeneralRe: Timer trouble -timer "dies" Pin
mhmoud rawas20-Nov-03 0:21
mhmoud rawas20-Nov-03 0:21 
GeneralRe: Timer trouble -timer "dies" Pin
EnkelIk24-Nov-03 21:54
EnkelIk24-Nov-03 21:54 
GeneralRe: Timer trouble -timer "dies" Pin
Heath Stewart20-Nov-03 3:13
protectorHeath Stewart20-Nov-03 3:13 
GeneralRe: Timer trouble -timer "dies" Pin
Xiangyang Liu 刘向阳23-Nov-03 9:09
Xiangyang Liu 刘向阳23-Nov-03 9:09 
Heath,

I haven't seen the code that causes this problme so I may not be making any sense here. Feel free to use your vast reserves of knowledge to correct me. Wink | ;)

The .NET timer class uses the .NET built-in thread pool to execute the timer callback function. The .NET built-in thread pool has a maximum of 25 threads as the default limit. If the timer callback function got stuck (with some database operations, for example) for longer than the timer interval (5 minutes in this case), the timer callback function will be invoked by a new thread from the thread pool. If this new thread got stuck again, then another new thread from the thread pool will be used.

Anyway, under some conditions, the timer can exaust all 25 threads from the thread pool. I have posted a simple example in a message after my article Creating Your Own Thread Pool In .NET[^] to demonstrate this.

If there is no easy way to figure out what caused the timer callback to stuck, then the solution may be not using the .NET timer class at all or restarting the applcation when too many threads are being used to handle the timer event.





My articles and software tools





GeneralRe: Timer trouble -timer "dies" Pin
Heath Stewart24-Nov-03 4:33
protectorHeath Stewart24-Nov-03 4:33 
GeneralRe: Timer trouble -timer "dies" Pin
Xiangyang Liu 刘向阳24-Nov-03 14:28
Xiangyang Liu 刘向阳24-Nov-03 14:28 
GeneralRe: Timer trouble -timer "dies" Pin
EnkelIk24-Nov-03 22:02
EnkelIk24-Nov-03 22:02 
GeneralProblem while sending mail from windows service using MSMAPI Pin
alexander13219-Nov-03 20:35
alexander13219-Nov-03 20:35 
GeneralRe: Problem while sending mail from windows service using MSMAPI Pin
Heath Stewart20-Nov-03 3:01
protectorHeath Stewart20-Nov-03 3:01 
GeneralRe: Problem while sending mail from windows service using MSMAPI Pin
alexander13220-Nov-03 3:29
alexander13220-Nov-03 3:29 
GeneralRe: Problem while sending mail from windows service using MSMAPI Pin
Heath Stewart20-Nov-03 3:42
protectorHeath Stewart20-Nov-03 3:42 
GeneralRe: Problem while sending mail from windows service using MSMAPI Pin
Xiangyang Liu 刘向阳23-Nov-03 9:27
Xiangyang Liu 刘向阳23-Nov-03 9:27 
GeneralHelp Displaying Unicode String Pin
WorldNomad19-Nov-03 19:19
WorldNomad19-Nov-03 19:19 
GeneralRe: Help Displaying Unicode String Pin
Heath Stewart20-Nov-03 2:51
protectorHeath Stewart20-Nov-03 2:51 
GeneralRe: Help Displaying Unicode String Pin
WorldNomad20-Nov-03 16:41
WorldNomad20-Nov-03 16:41 
GeneralMake control draw on top of other forms Pin
JacksonBrown196019-Nov-03 12:37
JacksonBrown196019-Nov-03 12:37 
GeneralRe: Make control draw on top of other forms Pin
Heath Stewart20-Nov-03 3:55
protectorHeath Stewart20-Nov-03 3:55 
GeneralRe: Make control draw on top of other forms Pin
JacksonBrown196020-Nov-03 5:11
JacksonBrown196020-Nov-03 5:11 
GeneralProblem testing NetworkStream for remote close Pin
ChiPlastique19-Nov-03 12:25
ChiPlastique19-Nov-03 12:25 
GeneralRe: Problem testing NetworkStream for remote close Pin
Kentamanos19-Nov-03 12:53
Kentamanos19-Nov-03 12:53 
GeneralShell context menu Pin
Ludwig Stuyck19-Nov-03 11:14
Ludwig Stuyck19-Nov-03 11:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.