Saturday, February 19, 2011

Parallel.For and Parallel.ForEach in .NET 4.0

Basically Parallel.For and Parallel.ForEach is very similar to For and ForEach except that  Paralle.For and ForEach use Multiple threads to execute different iterations of the loop body.  Using Parallel loops are very good way to  speed of the multicore machines.

image

when we execute the above code. here is the result .

image

Nandri(Thanks)

SreenivasaRagavan.

No comments: