Microsoft previews parallel processing for .NET Framework

With the multicore era already well upon us, the opportunities for multithreading are only now being recognized. Yesterday, Microsoft offered developers a taste of true parallelism with an experimental library for .NET.

Already, perhaps the most game-changing addition Microsoft has made to its .NET Framework is the addition of Language Integrated Query (LINQ), a long-sought provision that enables records or tables of data to be addressed within a single variable, all-at-once. If you're not a developer already, it's difficult to see how much of a breakthrough this really is.

For decades, database programmers had the luxury of being able to refer to massive tables as singular objects. If you give everyone a raise, you write a program to give a raise of x percent to, essentially, everyone at once. If you were to write the same program using a conventional high-level language like C++, C#, or Visual Basic, you'd have to write a kind of loop (which Microsoft calls a foreach) that steps through each employee one at a time, but only after executing a convoluted call that translates record set logic into sequential, slow, procedural logic.

That kind of translation was at one time the "hallmark" of the original ActiveX Data Objects (ADO) library, but now with LINQ, the set logic that comes from database programming is integrated into the high-level language.

This changes the meaning of doing something "all at once," because now, you don't have to break down your data into repetitive cycles or multi-iteration loops. You'd think that "all at once" would, by design, be parallel. It's not, and that's for a non-obvious reason: Maybe your program doesn't split your terms up into individual items, one-at-a-time, but under the hood, the compiler's doing that for you.

Now comes a concept that has probably been under development at Microsoft since the time LINQ was first incubated, but could only be tested in the field at the onset of Visual Studio 2008: It's called PLINQ (Parallel Language Integrated Query), and what it involves is basically a mild change to the existing LINQ syntax for C# and Visual Basic.

That change comes in the form of a method that's tacked onto the name of the variable used to address a LINQ (or PLINQ) database table: .AsParallel(). All it requires is a reference to a new assembly, System.Concurrency.dll, at compile time. And all it essentially says is this: If there are multiple threads available -- and these days, there typically are -- use them all at once.

"PLINQ allows LINQ developers to take advantage of parallel hardware -- including achieving better performance and building more intrinsically scalable software -- without needing to understand concurrency or data parallelism," write Joe Duffy and Ed Essey in a recent article for MSDN Magazine. "The programming model is simple, enabling a broader number of developers to take advantage of more parallel hardware."

Since Microsoft has never been one to carry forward a slightly decent name from the project's development period (Escher, Avalon, Viridian), the first preview of this library is now available as what it has decided to call Parallel Extensions to .NET Framework 3.5, or ParallelFX for short.

As a preview release only, Microsoft warns, the company reserves its right to choose whether or not the final edition is ever officially released. So the viability of this new library in the general market may be determined by the level and quality of feedback its developers receive.

Comments are closed.

© 1998-2019 BetaNews, Inc. All Rights Reserved. Privacy Policy - Cookie Policy.