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

Parallelization with Parallel.For and Parallel.ForEach

Loop operations that repeat more than a thousand times in loops use the most processor time. Therefore, when looking for places in your application that can benefit from parallelization, start by evaluating loops. The goal is to distribute the workload to as many processor cores as possible.

Remember the example in Chapter 5, that reduced image size by decreasing the number of pixels within it? A processor core had to iterate through an image, line by line, and transfer only each x pixel into a new smaller image. This procedure is amenable to distribution across several processor cores. Suppose that you have a system with four cores (not unusual for modern computers and notebooks). The first ...

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