J
Jason Barnett
I've developed a Windows Service that is designed to perform some work every
five minutes. Within OnStart, I'm creating a worker thread that loops until
the thread is aborted (usually when the service is stopped). Within the
loop, the thread calls a function to perform the work, logs success/failure
of the work performed, then sleeps for the remaining 5 minutes.
I'm experiencing a problem where the service seems to hang; nothing is
logged but the services appears to be "Started". This problem occurs
intermittenly. The only resolution I've found thusfar, has been to cycle the
service. At one client site, the problem occurs about every few months so
its not a big deal to cycle the service. At another client site, the problem
occurs about every week or two; so cycling the service is still very
inconvenient.
Does anyone have any idea how I might troubleshoot this issue?
Alternatively, do you know of any good programming pattern examples that
might be good for me to look at; for modeling my service after?
five minutes. Within OnStart, I'm creating a worker thread that loops until
the thread is aborted (usually when the service is stopped). Within the
loop, the thread calls a function to perform the work, logs success/failure
of the work performed, then sleeps for the remaining 5 minutes.
I'm experiencing a problem where the service seems to hang; nothing is
logged but the services appears to be "Started". This problem occurs
intermittenly. The only resolution I've found thusfar, has been to cycle the
service. At one client site, the problem occurs about every few months so
its not a big deal to cycle the service. At another client site, the problem
occurs about every week or two; so cycling the service is still very
inconvenient.
Does anyone have any idea how I might troubleshoot this issue?
Alternatively, do you know of any good programming pattern examples that
might be good for me to look at; for modeling my service after?