views:

72

answers:

3

I am pretty much interested into using the newly enhanced Parallelism features in .NET 4.0.

I have also seen some possibilities of using it in F#, as much as in C#.

Despite, I can only see what PLINQ has to offer with, for example, the following:

var query = from c in Customers.AsParallel()
            where (c.Name.Contains("customerNameLike"))
            select c;

There must for sure be some other use of this parallelism thing.

Have you any other examples of using it? Is this particularly turned toward PLINQ, or are there other usage as easy as PLINQ?

Thanks! =)

+4  A: 

The new parallel programming features provided in .NET 4 are not limited to just PLINQ.

As stated by Microsoft: "Visual Studio 2010 and the .NET Framework 4 enhance support for parallel programming by providing a new runtime, new class library types, and new diagnostic tools. These features simplify parallel development so that you can write efficient, fine-grained, and scalable parallel code in a natural idiom without having to work directly with threads or the thread pool."

I would recommend that you review Parallel Programming in the .NET Framework as a good starting place.

Overall, .NET 4 and Visual Studio 2010 provide these features:

I personally have found the Task and Task{T} classes in the Task Parallel Library to be more flexible when creating and coordinating asynchronous work.

Oppositional
There are multiple examples at the teams blog http://blogs.msdn.com/pfxteam there are also a ton of samples available at http://code.msdn.microsoft.com/ParExtSamples.
Rick
+1  A: 

Watch this Scott Hanselman presentation from 39:30 to 48:36. (Starting at 39 minutes, 30 seconds into the talk).

Robert Harvey
+1  A: 
Ade Miller
Thanks for the hint. =) Besides, could you post a simple code sample to show address another way than PLINQ? Thanks! =)
Will Marcouiller
Will, I updated my answer with a lot more detail. It just so happens your particular example maps best to PLinq.
Ade Miller
@Ade Miller: Thank you for this update. My example is suitable for PLINQ as this is what has gained my attention the most, and this is also the most used instance to explain the possibility of parallelism. Your examples are great! I already upvoted, but I would like to upvote your answer again. And it's a shame that I can't accept two answers as the solution to my question. Besides, I shall study your examples to get acquainted with parallelism in .NET 4.0. I also shall download the sample of your book and see if this could be a good reference for me to use. Thanks Ade!
Will Marcouiller