BT

PLINQ: Parallel Programming For The CLR

by Jonathan Allen on Jan 30, 2007 |

While Microsoft's developer devision refines the core of LINQ for the Visual Studio 2007 release, work has already begun on the next version feaures. The one most interesting to those looking to support multi-core computer is Parallel LINQ (PLINQ). Joe Duffy's presentation at Declarative Aspects of Multicore Programming (DAMP) workshop gives a good overview of some of background and issues of LINQ and Parallel LINQ.

PLINQ uses the same syntax as LINQ, but is based on the parallel query execution techniques you would find in major database applications like SQL Server and Orcale.

Prior to LINQ, .NET developers had full control over how queries were executed. The downside to having that much control is that even the most basic search procedures required had-rolling loop and evaluation code. LINQ moves all those details down to the compiler level, essentially making them implementation details.

Since Microsoft controls the implementation of LINQ queries, it can redefine them at runtime to use parallel techniques such as partitioning and pipelining without having developers make significant changes their code.

Parallel LINQ isn't a free ticket into the land of multi-cores, there is still a lot of issues to address. The biggest one is that shared memory still has to be considered. Unlike languages designed with parallelism in mind such as T-SQL, the CLR's type system doesn't support the concept of a pure function. Or in other words, the runtime has no way to know if a function is thread-safe, without side effects, or even if it will always return the same value for a given argument.

Without this information, knowing when it is safe to use parellel techniques becomes very hard. There are on-going research projects like Spec# which seek to address this, at this time it is still pretty much wait and see.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT