Wednesday, 15 October 2008

.NET Framework 4 features: Parallel Extensions

Today most of new processors are dual core (let me say multi-core).
Intel and AMD are trying to convince programmers to use the benefits of multi-core processing. You can find many white papers from both Intel and AMD that explains how we can write our codes so that it can be executed better in multi core processors.

One way of achieving this goal is to write your programs using multi threads, and let compiler decide which threads can be executed concurrently in different cores.
Of course this is the easiest way possible, but not the best approach.

Intel have some tools that with using them you can define a new thread (rather than the thread which is provided by your programming language) and you can define some flags to say which threads can run concurrently. This approach works well with Intel processors, but making a general purpose code with this approach is a headache!

Today when I was reading some beta news about .NET features, I saw something very interesting: Parallel Extensions.

In perhaps the most significant development in the brief history of the field of implicit parallelism in computing, one of Microsoft's development teams announced last Friday that the next .NET Framework 4.0 -- the first glimpses of which we'll see later this month from PDC in Los Angeles -- will include the so-called Parallel Extensions as a standard feature. This after the Extensions were first introduced in a Community Technology Preview last November.

The significance of these extensions is that they enable existing .NET languages (today, most predominantly, C#) to incorporate implicit parallelism directly in programs. In other words, rather than simply write ordinary procedural code and use compiler switches to determine whether code can be forked into parallel threads, a developer can use entirely new syntax to invoke methods that execute multiple threads concurrently.

You can read more about this feature in BetaNews.

For C/C++ developers, Intel has a software solution, named Intel Parallel Studio. Here you can find more about this solution.