(The full set of ParallelExtensionsExtras Tour posts is available here.) In our last ParallelExtensionsExtras tour post, we discussed implementing an extension ToObservable method for Task<TResult>. This is just one of a myriad of extra pieces of functionality that are useful with Tasks, and the TaskExtrasExtensions...
(The full set of ParallelExtensionsExtras Tour posts is available here.) In our previous ParallelExtensionsExtras tour post, we discussed a custom implementation of the LINQ operators, in particular for working with Task<TResult> instances in an asynchronous manner. There is already an impressive implementation of the ...
(The full set of ParallelExtensionsExtras Tour posts is available here.) The .NET Framework developer center provides a concise description of Language Integrated Query (LINQ):LINQ is a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with ...
The Task Parallel Library in the .NET Framework 4 provides an opt-in feature that enables parent-child relationships between tasks. This relationship brings with it some additional behaviors, including that a parent task is not considered completed until all of its child tasks have completed, and that exceptions from ...
.NET 2.0 introduced Generics to allow enhanced code reusability and type safety. Since then, generic collections (IEnumerable<T>, List<T>, Dictionary<T>, etc.) have become standard and are recommended over their non-generic counterparts (IEnumerable, ArrayList, HashTable, etc.). As a result, Parallel.ForEach only ...
Reed Copsey, Jr. has been writing a great series of articles on parallelism with the .NET Framework 4. The articles provide the insights of an expert developer who has been using parallelism with .NET to speed up real-world programs. Recommended reading.Parallelism in .NETIntroductionPart 1, Decomposition&...
The aim of this post is to help developers writing applications in which operations may need to be performed and then later undone due to a subsequent failure. It shows a pattern for how to maintain such a consistent application state by utilizing functionality from the Task Parallel Library (TPL) in the .NET Framework 4.
For the purposes of ...
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 ...
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.  ...
On Code Gallery, we have a plethora of samples that highlight aspects of the .NET Framework 4 that help with writing scalable and efficient parallel applications. This post examines each of those samples, providing an overview of what each provides...