O'Reilly logo

Programming Windows® Services with Microsoft® Visual Basic® 2008 by Michael Gernaey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Threads

Every application or service has at least one thread. Although the service will usually have much more than just one thread, it has to have at least one thread to perform any work. When an application (or in this case, a service) starts, its primary thread is fired up and begins processing messages from the system. These messages can be mouse clicks, keyboard input, custom events, operating system alerts, and more.

The service we are working with in this book has a primary thread called by the Service Control Manager (SCM). Remember that the SCM states that your service is running only if your <OnStart> method returns within 30 seconds of the start request. Imagine, however, if you only used the primary thread to do work. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required