.NET Parallel Programming

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

Are you using the CCR? We’d love to hear about it.

Are you using the CCR (Microsoft Robotics' "Concurrency & Coordination Runtime") today in production applications or libraries, and in particular for non-robotics purposes?  If so, we’d love to hear about your experiences, and any and all information you’re willing to share would be very welcome.  What do you like ...
Comments are closed.0 0

FAQ :: Are all of the new concurrent collections lock-free?

(This answer is based on the .NET Framework 4.  As the details below are undocumented implementation details, they may change in future releases.)No.  All of the collections in the new System.Collections.Concurrent namespace employ lock-free techniques to some extent in order to achieve general performance benefits, but traditional ...

FAQ :: You talk about performance, speedup, and efficiency…what do you mean exactly?

All of these terms are overloaded, even in the context of parallel computing.  However, we’ve used them extensively to describe how well our parallel algorithms and demo applications work.  And sometimes, we throw them around carelessly on the blog, forums, etc., so here are our general definitions.Performance is an attribute ...

FAQ :: The Debugger does not correctly handle Task exceptions?

The following code correctly observes and handles a Task exception and should print “gotcha!” to the console.  By default though, the Debugger will report a crash.Task t = Task.Factory.StartNew(() => { throw new Exception("poo"); }); try { t.Wait(); } catch (AggregateException) { Console.WriteLine("gotcha!"); } The issue ...

ConcurrentDictionary’s support for adding and updating

ConcurrentDictionary<TKey,TValue> is a new type in the .NET Framework 4, living in the System.Collections.Concurrent namespace.  As noted in the MSDN documentation, ConcurrentDictionary “represents a thread-safe collection of key-value pairs that can be accessed by multiple threads concurrently.”  While ...

FAQ :: Why is the speedup not X on my X-way machine?

We’ll be regularly posting answers to frequently asked questions that we’ve gotten on the forum, internal email lists, etc.  Here’s the first – enjoy! Why is the speedup not X on my X-way machine?  Or, why does my parallel code run slower?  Less than ideal speedup can typically be attributed to two things: 1.  ...

Feedback usabilla icon