What Is Thread Cleanup?

We have now expanded the code so that we can call methods on the class and/or code within thread functions. However, we have not yet made it possible to clean up the threads if the user were to stop the service while the threads were actively processing. We need to have control over the cleanup of the threads because unlike applications that run on the client, services are required to either shut down quickly or update the Service Control Manager with an estimate of how much longer the services need to shut down. If the Services does not request more time, the SCM will consider the service to be in a hung or unresponsive state, which will most likely require a reboot of the system. In some cases you can look in Task Manager ...

Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.