Showing results for November 2011 - .NET Parallel Programming

Nov 11, 2011
0
0

How to use C++ AMP from C# using WinRT

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

[Updated 5/17/2012 for Visual Studio 11 Beta] In a previous article, How to use C++ AMP to C#, we described how you can use P/Invoke to call into C++ AMP and accelerate your C# apps on GPUs and other heterogeneous hardware. In this post, we'll take a look at how the same task becomes easier in Windows 8 using WinRT. Before attempting to call C++ ...

C++
Nov 10, 2011
0
0

New in .NET 4.5: ThreadLocal.Values

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

Available since .NET 4, ThreadLocal<T> is a container that holds a separate value for every thread. In practice, ThreadLocal<T> is often convenient for storing per-thread counters, resources, or partial results. As mentioned earlier on this blog, we have been thinking about adding a Values property to enumerate over the values from all...

Parallel Extensions.NET 4.5Code Samples
Nov 10, 2011
0
0

PLINQ Queries That Run in Parallel in .NET 4.5

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

One interesting thing to know about PLINQ is that not all queries are guaranteed to execute in parallel (See PLINQ Queries That Run Sequentially for reference). You can think of the AsParallel method as a hint to run in parallel for query shapes that it believes will be faster. By default, PLINQ prefers to use a simple sequential algorithm over a p...

Parallel Extensions.NET 4.NET 4.5
Nov 10, 2011
0
0

Paper :: TPL Performance Improvements in .NET 4.5

Danny Shih
Danny Shih

We invested a lot of time into making parallel programming “just faster” for .NET 4.5.  You’ve already seen some neat tricks to ConcurrentDictionary.  There’s a lot more to say about improving the performance of the Task Parallel Library, and Joe Hoag has a written an excellent paper on the subject:TPL Performance ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Nov 10, 2011
0
0

Crafting a Task.TimeoutAfter Method

Joe Hoag
Joe Hoag

Imagine that you have a Task handed to you by a third party, and that you would like to force this Task to complete within a specified time period. However, you cannot alter the “natural” completion path and completion state of the Task, as that may cause problems with other consumers of the Task. So you need a way to obtain a copy or “proxy” of th...

Parallel ExtensionsTask Parallel Library.NET 4
Nov 9, 2011
0
0

Exception Handling in TPL Dataflow Networks

Cristina Manu
Cristina Manu

A “dataflow block” is represented by a class implementing the IDataflowBlock interface. The state of a dataflow block is represented by the state of its IDataflowBlock.Completion Task, which itself has a Status property. When a dataflow block is in active state, meaning that it is currently doing processing or may do more processing in the future, ...

Parallel Extensions.NET 4.5Code Samples
Nov 8, 2011
0
0

ConcurrentDictionary Performance Improvements in .NET 4.5

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

ConcurrentDictionary is a popular concurrent data structure that was introduced in .NET 4. In the .NET 4.5 release, ConcurrentDictionary gets two performance improvements. One optimization is related to the way ConcurrentDictionary avoids torn reads and writes. To explain the background, all reference types and some value types are guaranteed to b...

Parallel Extensions.NET 4.5Code Samples
Nov 1, 2011
0
0

Updated Async CTP

Stephen Toub - MSFT
Stephen Toub - MSFT

In April, we released the Async CTP Refresh, and since then we've seen fantastic adoption of the technology.  We've also seen the technology landscape evolve.  Windows Phone 7.5, aka "Mango", was released.  Silverlight 5 has had both a Beta and an RC release.  And there have been multiple patches to Visual Studio and the .NET Fr...

Task Parallel Library.NET 4Async