O'Reilly logo

Professional Visual Basic 2012 and .NET 4.5 Programming by Todd Herman, Gastón Hillar, David McCarter, Rob Windsor, 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 19

Parallel Programming Using Tasks and Threads

What's in this chapter?

Understanding the task-based programming model, the Task Parallel Library, and its related hardware technologies

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 simple parallel producer-consumer pattern

Parallelizing LINQ queries using PLINQ

Wrox.com Code Downloads For This Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/remtitle.cgi?isbn=9781118314456 on the Download Code tab. The code is in the chapter 19 download and individually named according to the code file names listed throughout the chapter.

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 lightweight concurrency model introduced by Visual Basic 2010 with .NET Framework 4 and extended in Visual Basic 2012 with .NET Framework 4.5. A comprehensive treatment of the challenges offered by the new multicore designs could easily fill 600 ...

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