Simple Parallel ForEach threading example

A very efficient and clean way of multi threaded iterating through some lengthy tasks, is by using Parallel.ForEach. It takes a lambda expression with the body to execute for each task in the provided list. In this case we download a couple of weblog homepages to a string and show the length of the downloaded result and the current thread id of the task. More…