O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

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

Working with Tasks

At the beginning of this chapter, you saw that there are many possibilities to initiate and run methods on separate threads. As already mentioned, tasks have been available only since the release of .NET Framework 4.0, and they are not included in the .NET Compact Framework. A task corresponds to a thread in the thread pool. Using a task, you can easily run a method on its own thread. To create a Task instance, you can either use the TaskFactory static class (available through the Task class) or create one just like any other class.

Companion Content

Open the corresponding solution (.sln), which you can find in the \VB 2010 Developer Handbook\Chapter 28\SimpleTask folder.

'Always remember to perform these imports 'when working ...

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