.NET Parallel Programming

All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…

Wrapping an APM implementation with Future

In a previous post, I talked about implementing the Asynchronous Programming Model pattern using Future<T> from Parallel Extensions to the .NET Framework.  It's also possible to go in the opposite direction, to create a Future<T> from an existing APM implementation.As has been shown in previous examples, in this example we'll ...

Parallel loop performance

We've received several questions on the MSDN Forums for Parallel Extensions about the performance of the Parallel class, and specifically of the loop constructs we provided in the CTP.  We're very much aware that the performance of Parallel.For/ForEach in the CTP is not optimal, and that for some situations, the overhead for these ...

Implementing the Asynchronous Programming Model with Future

One of our design goals for the Task Parallel Library is to integrate well into existing asynchronous mechanisms in the .NET Framework.  And one of the most common concurrency-related patterns in the .NET Framework is the Asynchronous Programming Model (APM), which typically manifests as a BeginXx method that kicks off an asynchronous ...

Custom parallel looping constructs

For those of you that have examined the internals of the Task Parallel Library in our December '07 CTP release, you've likely noticed that the methods on the System.Threading.Parallel type are implemented on top of System.Threading.Tasks.Task type, and that they do so taking advantage of Task's self-replicating functionality.  The idea ...

Task Parallel Library on Channel 9

Charles from Channel 9 sat down with several of us from the Parallel Computing Platform team to discuss the Task Parallel Library component of Parallel Extensions. A video of the conversation is now available on Channel9: https://channel9.msdn.com/Showpost.aspx?postid=384229. We hope you like it, and as always, feedback is ...

Recursion and Concurrency

When teaching recursion in an introductory computer science course, one of the most common examples used involves a tree data structure.  Trees are useful in this regard as they are simple and recursive in nature, with a tree's children also being trees, and allow for teaching different kinds of traversals (in-order, pre-order, post-...

F# and the Task Parallel Library

Over on his blog, Don Syme has a post about F# and Parallel Extensions: "Over the coming year I expect we'll be seeing this library used very widely from F#, and we'll eventually be using the TPL as a key underlying technology for F# asynchronous workflows. TPL excels at CPU-intensive parallelism and exploiting multiple cores, ...