Parallel programming
As you may remember, we've already talked about asynchronous programming, when we were dealing with the async/await
keywords that appeared in .NET Framework 4.5 as a solution to avoid performance bottlenecks and improve the overall responsiveness of our applications.
Parallelism was present earlier, in version 4.0 of the framework, and it was programmatically related to the Task Parallel Library (TPL). But first, let's define the concept of parallelism (at least according to Wikipedia):
"Parallelism is a form of computation in which several operations can execute simultaneously. It's based on the 'Divide and Conquer' principle, fragmenting a task in smaller tasks, which are later solved in parallel."
This is, obviously related to hardware, and we should be aware of the difference between multiple processors and multiple cores. As Rodney Ringler says in his excellent book C# Multithreading and Parallel Programming by Packt Publishing:
"A multiple core CPU has more than one...