O'Reilly logo

Professional Visual Basic® 2010 and .NET 4 by Kent Sharkey, Rob Windsor, Gastón C. Hillar, Jonathan Marbutt, Billy Hollis, Bill Sheldon

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

Chapter 33. Parallel Programming Using Tasks and Threads

WHAT YOU WILL LEARN IN THIS CHAPTER

  • Understanding the new task-based programming model and the Task Parallel Library

  • Launching, controlling, managing, and synchronizing parallel tasks

  • Refactoring loops to run them in parallel using Parallel.For and Parallel.ForEach

  • Transforming existing sequential code into parallelized code

  • Measuring the speed gain and the scalability offered by parallelized code

  • Working with different degrees of parallelism

  • Understanding the advantages of working with concurrent collections

  • Implementing a parallel producer-consumer pattern

  • Parallelizing LINQ queries using PLINQ

In the last few years, multicore technology has become the mainstream in CPU designs, and microprocessor manufacturers continue to improve their processing power. However, the shift to multicore is an inflexion point for software design philosophy.

This chapter is about the new lightweight concurrency model offered by Visual Basic 2010 with .NET Framework 4 and its related hardware technologies. A comprehensive treatment of the challenges offered by the new multicore designs could easily fill 600 pages or more, so this chapter attempts to strike a reasonable balance between detail and succinctness.

LAUNCHING PARALLEL TASKS

It was really difficult to develop applications capable of taking full advantage of multicore microprocessors working with previous .NET Framework versions. It was necessary to launch, control, manage, and synchronize multiple ...

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