D
David Bartosik - MS MVP
I have a windows service that creates 5 worker threads, I'm finding that
over time the service is still going but the threads are evidently dead (no
work is done). Since I don't think they can actually die in the while loop
I'm assuming they get 'hung'.
I'm trying to determine how to look for and find a hanging thread so that it
can be killed and replaced.
I'm looking at threadstate but wouldn't a hanging thread still be considered
running so testing for stopped wouldn't work?
I'm considering a timing idea where if the work is taking to long
(pre-determined variable) I kill the thread and replace it. But what would
be the correct way to do this? I'm looking at Timer but it looks like that
is used to time an event at a regular interval versus timing of a process.
ideas?
--
David Bartosik - MS MVP
for Publisher help:
www.davidbartosik.com
enter to win Pub 2003:
www.davidbartosik.com/giveaway.aspx
over time the service is still going but the threads are evidently dead (no
work is done). Since I don't think they can actually die in the while loop
I'm assuming they get 'hung'.
I'm trying to determine how to look for and find a hanging thread so that it
can be killed and replaced.
I'm looking at threadstate but wouldn't a hanging thread still be considered
running so testing for stopped wouldn't work?
I'm considering a timing idea where if the work is taking to long
(pre-determined variable) I kill the thread and replace it. But what would
be the correct way to do this? I'm looking at Timer but it looks like that
is used to time an event at a regular interval versus timing of a process.
ideas?
--
David Bartosik - MS MVP
for Publisher help:
www.davidbartosik.com
enter to win Pub 2003:
www.davidbartosik.com/giveaway.aspx