IntroductionParallelization is a major Enhancements in Microsoft dot.net 4.0 in .netframework 4.0 give`s advantage of multi core processors . Now you can divide load of your functions Parallelly on Multi Core Processors. Advantage Of Parallel ProgramingMany applications contain some segments of code that will benefit from parallelization; and some that will not. Code that is likely to benefit from being run in parallel will probably have the following characteristics: • It can be broken down into self-encapsulated units. • It has no dependencies or shared state. A classic example of code that would benefit from being run in parallel is code that goes off to call an external service or perform a long-running calculation (for example, iterating through some stock quotes and performing a long-running calculation by iterating through historical data on each individual quote). This type of problem is an ideal candidate for parallelization because each individual calculation is independent so can safely be run in parallel. Some people like to refer to such problems as “embarrassingly parallel” (although Stephen Toub of Microsoft suggests “delightfully parallel”!) in that they are very well-suited for the benefits of parallelization.(Ref: Apress.Introducing.dot.NET.4.0.with.Visual.Studio.2010.Feb.2010) I Try to Show Deference between Serialized and Parallel functionsSanpshots Here , i have given the how to write code for parallel invoking.
Sample Project SourceDownload source files -33 kb |