Thread dies in windows service -
08-05-2003
, 08:56 AM
Hello:
I have a windows service that dequeue message from an MSMQ queue and
does some processing. In the OnStart method, I spawn a thread, that
sleeps for 5 seconds, wakes up, checks the queue, dequeues everything,
goes to sleep for five seconds and so on.
I have noticed that after a certain time period -- sometimes days,
sometimes weeks, the thread dies. So everything gets queued up.
Is there anyway to monitor the thread? I want to set up some way of
check for a heartbeat every few hours and to be notified by an email
if there is no heartbeat.
Is there anyway to do this? I would like the windows service to know
that the thread has died and spawn a replacement thread.
Thanks In Advance.
Surya |