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

Extending the Threading Model

At this point, we have created a multithreaded service by adding a worker thread. However, we are currently limited to one worker thread. We’re going to change that now.

We have a few ways to resolve the fact that we’re using only one worker thread. A couple of factors affect what we decide to do. First, we need to consider the requirements of the problem we are trying to solve. Currently we’re polling a file location to determine whether any .txt files exist and, if they do, reacting to that information.

To determine the threading model we need, we have to ask several questions:

  • Can we monitor more than one file folder?

  • Can we monitor more than one file type per folder?

  • Can we move files of diffent types to different ...

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