- Dev Blogs
- .NET Parallel Programming
.NET Parallel Programming
All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…
Latest posts
Native concurrency, tools, and TM
The Parallel Computing Platform team at Microsoft is working on much more than Parallel Extensions to the .NET Framework...A few weeks back, Charles from Channel 9 spoke with us about our efforts on supporting concurrency and parallelism in native code; the video of that conversation was released this week, and you can view it at https://channel9.msdn.com/posts/Charles/The-Concurrency-Runtime-Fine-Grained-Parallelism-for-C. Niklas Gustafsson, an architect on our team, was also recently on Intel's Parallel Programming Talk podcast discussing the Concurrency Runtime; you can listen to that podcast at http://softwar...
Parallel Programming and the .NET Framework 4.0
Last week, the VP of the Developer Division at Microsoft announced the next version of Visual Studio and the .NET Framework: Visual Studio 2010 and the .NET Framework 4.0. In line with that, the folks at Channel 9 have been posting videos left and right about a bunch of the new Visual Studio features, and there should be a plethora of interesting information and discussions flowing at the PDC in a few weeks. For those of you that are planning to attend the PDC, you’ve likely reviewed the list of announced sessions and found a whole bunch on parallelism, including the following: Parallel Progr...
Parallelism in October 2008 MSDN Magazine
The October 2008 issue of MSDN Magazine just went online yesterday, and it's chock full of content on parallelism. Definitely worth a cover to cover read!
Webcasts on Parallelism from France
A few months back, Keith Yedlin and Steve Teixeira from the Parallel Computing Platform team were in France visiting with customers. While there, they presented on our parallelism efforts, and with the help of the great team from Microsoft France, this presentation is now available online as a series of webcasts (the titles are all in French, but the contents of the recordings are in English): And for those of you interested in reading about Parallel Extensions in French, Eric Vernié from Microsoft France has an article on the subject: Enjoy! Thanks to Eric...
Feedback requested: Enumerating Concurrent Collections
The June 2008 CTP of Parallel Extensions contained a first look at some of the work we're doing to augment the .NET Framework with a set of additional coordination data structures that aid in the development of highly concurrent applications. This included two thread-safe collections, ConcurrentQueue<T> and ConcurrentStack<T>, and it's probably not giving away too much to say that we're working diligently on additional collections that aid in key scenarios for parallel programming. For the most part, these collections are similar to the exsiting non-thread-safe counterparts in the .NET Fra...
Most Common Performance Issues in Parallel Programs
Since the goal of Parallel Extensions is to simplify parallel programming, and the motivation behind parallel programming is performance, it is not surprising that many of the questions we receive about our CTP releases are performance-related.Developers ask why one program shows a parallel speedup but another one does not, or how to modify a program so that it scales better on multi-core machines.The answers tend to vary. In some cases, the problem observed is a clear issue in our code base that is relatively easy to fix. In other cases, the problem is that Parallel Extension does not adapt well to a particular ...
ParallelWhileNotEmpty
Parallel Extensions includes the System.Threading.Parallel class, which provides several high-level loop replacement constructs like For and ForEach. In previous blog posts, we've taken a look at implementing other loops, such as for loops with arbitrary initialization, conditional, and update logic, range-based loops, and a parallel while. There's another interesting loop construct which some parallel libraries provide, that of a loop which processes elements from a collection until that collection is empty, but which allows the processing of items in the loop to add more items to the collection. Suc...
Waiting for Tasks
Parallel Extensions makes it easy to wait for Tasks to complete. Task exposes a Wait method, which can be used trivially: Task t = Task.Create(...); ... t.Wait();Task also exposes several static methods for waiting on an array of tasks, either for all of them to complete or for any of them to complete: Task t1 = Task.Create(...); Task t2 = Task.Create(...); Task t3 = Task.Create(...); ... Task.WaitAll(t1, t2, t3); // or Task.WaitAny(t1, t2, t3)Moreover, Tasks have implicit parent/child relationships, and a parent Task will wait for any of its child tasks to complete before it completes: Task p = Task.Create...
Feedback requested: TaskManager shutdown, Fair scheduling
One of the primary reasons we've released CTPs of Parallel Extensions is to solicit feedback on the design and functionality it provides. Does it provide all of the APIs you need to get your job done? Are there scenarios you wished the APIs supported and that you need to work around in klunky ways? And so forth. We've received some terrific feedback thus far, we've already made changes based on it, we're currently making changes based on it, and we'll continue making changes based on it moving forward.We continually have discussions internally about additional support we could provide.&nbs...