.NET Parallel Programming
All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…
Latest posts
Parallel Computing Platform at TechEd 2008
Heading to TechEd 2008? Come discover some of the exciting technologies the Parallel Computing Platform team is working on. We're presenting four sessions on parallelism at the Developer conference: DVP205 The Microsoft Parallel Computing Initiative: Bringing Concurrency to the Masses Tuesday, June 3 10:30 AM - 11:45 AM, S210 B Software is headed for a fundamental change. Over the last 30 years, developers have relied on exponential growth in computing power in order to write applications that run fast. However, whereas the average PC clock speed increased more than ten-fold between 1993 and 1999, the average p...
Multiple thread-local state elements in a loop
The Parallel.For/ForEach loop constructs included in Parallel Extensions support a variant of thread-local state to aid in efficiently passing data between loop iterations. Consider one such overload of Parallel.For: public static void For<TLocal>( int fromInclusive, int toExclusive, Func<TLocal> threadLocalInit, Action<int, ParallelState<TLocal>> body, Action<TLocal> threadLocalFinally); The threadLocalInit delegate is called once per thread for each thread involved in processing loop iterations, and it's called on the thread before the thread processes any ite...
Microsoft Visual Studio 2008 SP1 Beta and .NET Framework 3.5 SP1 Beta
Download the Visual Studio 2008 SP1 Beta and try it out with the Dec07 CTP of Parallel Extensions. There are no known compatibility issues at this time, though it is always possible that we missed something crucial to your prototyping scenarios. Please let us know about your experiences, so that we can factor that into our development. · Microsoft Visual Studio 2008 SP1 includes support for SQL Server 2008, new ADO.NET features such as the Entity Framework, improvements to the WPF designers, WCF templates for Silverlight projects, debugger su...
Q&As from the 2008 Financial Services Developer Conference
A few weeks ago, I presented on Parallel Extensions to the .NET Framework at the 6th annual Microsoft Financial Services Developer Conference (the decks from the conference are now available online). I had a great time and a great audience, and during the presentation on Thursday I received some good questions. Here are some of them along with answers.Question: This stuff looks really cool, but why do we need to modify our code to use Parallel Extensions; why can't you just automatically parallelize it for me?Igor Ostrovsky, a developer on our team, has a nice set of explanations in his responses to s...
New PLINQ video on Channel 9
Igor and Joe from our Parallel Extensions team sat down with Charles from Channel 9 to discuss the inner workings of PLINQ. The video of the conversation is now available at https://channel9.msdn.com/showpost.aspx?postid=390736. "Continuing our exploration of the Parallel Computing Platform and the folks who think it up and build it, we sit down with software developers Joe Duffy (he wrote the original Parallel LINQ Think Week paper that Bill Gates read and obviously enjoyed!) and Igor Ostrovsky (he spends his time implementing PLINQ and associated technologies) to deeply dig into how PLINQ works....
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 take advantage of the "promise" capabilities provided by Future<T>. This allows a Future<T> to be created without a Func<T> delegate, such that the future's Value and Exception properties can be set explicitly, but only once; any thread waiting on the...
Jobs on the Parallel Computing Platform team
As mentioned in a previous post, we're actively hiring for the Parallel Computing Platform team at Microsoft. Whether you're interested in PM, dev, test, or product management, we have some awesome positions available! You can see a list of them and apply for those positions here.
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 constructs will be too much for a variety of situations. That's ok: we released the preview of the Task Parallel Library in the December CTP to solicit early feedback on the APIs we're providing (e.g. Are they useful? What's missing? etc.), and to do so and to get the p...
Ordering the output of parallel computations
Frequently when attempting to do multiple operations in parallel, ordering becomes an issue. Consider an application where I'm rendering and writing out to a video file frames of a movie: for (int i = 0; i < numberOfFrames; i++){ var frame = GenerateFrame(i); WriteToMovie(frame);}For a bit of pizzazz, I'll show the same thing with LINQ: var frames = from i in Enumerable.Range(0, numberOfFrames) select GenerateFrame(i);foreach (var frame in frames) WriteToMovie(frame);Now, my GenerateFrame method is...