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

Various Options for Starting a Thread

The Microsoft .NET Framework offers several options for starting a task on a single thread:

  • Call the method that runs the task asynchronously by using a delegate. This is the easiest method to start a thread—but it is also the one that offers the least control.

  • Use one of the special parallelization methods in the Parallel class, such as Parallel.For or Parallel.ForEach.

  • Create a LINQ query and parallelize it by adding AsParallel.

  • In Windows Forms applications, you can use the BackgroundWorker component. This helps with updating the user interface because in Windows Forms applications—and Windows Presentation Foundation (WPF) applications—you can access UI controls only from the thread on which those controls ...

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